LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi with Subpanel crashes when Subvi is called a second time

Hi,

 

I'm fairly new to Labview and atm. I'm experimenting with running my Subvi's in a Subpanel. 

 

It all works fine when I run the Subvi in the Subpanel the first time but if the operator calls the Subvi again then the Main Vi freezes with the subvi open in the subpanel. 

What am I doing wrong? 🙂 

Subpanel Subvi call.jpg

0 Kudos
Message 1 of 6
(1,116 Views)

That's going to be hard to say without the subVI.

 

Why all the dynamic stuff? Pass the subPanel reference to the sub VI, let the sub VI put itself in the subpanel (and remove itself when done).

 

There's no need to complicate things with dynamic calling.

0 Kudos
Message 2 of 6
(1,092 Views)

The Subvi is far from done, string control and if the Return key is pressed then it send a true to the Main Vi which switches to the next step of the test.

Examples is highly appreciated. 

Subvi.jpg.png

0 Kudos
Message 3 of 6
(1,072 Views)

The loop seems redundant, although there's still no code to evaluate. Is there another event? Who knows...

 

The sequence structure is redundant. They usually are. Note that it nothing enforces it's execution before entering the event structure... Exactly the same as without it.

 

It's hard to give examples when all we have is the code that doesn't work. We'd need to know exactly what you want to do.

Here's an image 😎:

VI in SubPanel.PNG

0 Kudos
Message 4 of 6
(1,040 Views)

Hi there,

 

I had a similar issue. In my case, the VI I was loading in the subpanel had an xcontrol from the webview2 package.

To fix that issue a simply cleared the compiled object cache...

 

If someone is having a similar issue I hope it helps...

 

Best,

 

Thomas

 

0 Kudos
Message 5 of 6
(458 Views)

So here is an example.  I have some code that I want to run, be able to look at the results (displayed nicely for me), and then have the routine exit and leave the sub-Panel, allowing me to continue running the main (calling) routine.

Sub-panel ExampleSub-panel Example

 

Note that the VI being run in the Sub-Panel is a While Loop (look at the Icon boundary) -- I stuff it into the sub-Panel so that I see its Front Panel, gather two inputs for it, and call it.  What I see is it (quickly) processes the inputs and provides me with a "View to the Data", along with whatever Front Panel controls I've provided in "Show Sample" to manipulate what it is showing me.  When I push the "Stop" button inside "Show Sample" to stop the sub-Panel code, the function exits, hits the "Remove VI" command, and I continue with the rest of the Main code.

 

If your Sub-Panel code needs to do "different things" when called at "different times", just design it that way, with a Control input that determines "where it starts" and possibly a control inside the sub-Panel code to determine when it ends.  [Note that if you want to "have your cake and eat it, too", you can pass in a Queue reference to allow the caller to enqueue a "Quit now" message, but this seems to me to be a lot "messier", though I will admit to doing it this way ...].

 

Bob Schor

0 Kudos
Message 6 of 6
(441 Views)