LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Switching multiple subvi back and forth in Subpanel whithout closing them

Solved!
Go to solution
Highlighted

On my main vi I have two OK Buttons(OK Button1 and OK Button2) and a subpanel. I have two subvi Sub1 and Sub2 both have a while loop running with some front panel control. 

I want to load Sub1 when I click OK Button 1 and Sub2 when I click OK Button 2. But the condition is when I load Sub2 my Sub1 should not get close, it should go to background and keep running so that it may pop up again when I press OK Button1. 

0 Kudos
Message 1 of 6
(125 Views)

Hi Leonardo,

 

your subVIs will not go into "stop" when you unload them from your Subpanel: so all you need to do is to load the needed subVI into the Subpanel!

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 6
(121 Views)

GerdW is correct (but I already knew he would be).  I have an application that runs up to 24 acquisition Stations for 2-3 hours, with the SubPanel allowing you to look at any one of them.  They keep running (one of the sub-Panels displays the graph over the past period of time) and you can see a continuous trace as you switch between different Stations.  All I do is say "Put Station 1 into the sub-Panel" (or, if I don't want to look at any of them, I say "Remove VI" and the sub-Panels go blank -- I can, of course, turn them back on by choosing a Station again).

 

Bob Schor

Message 3 of 6
(88 Views)

Hi bob

I tried your approach but, being a newbie, i am stuck.

i am able to switch Subvis with button click but it shows only a snapshot of subvi's front panel not the running thing. please see my code and suggest.

0 Kudos
Message 4 of 6
(65 Views)
Solution
Accepted by topic author Leonardo111
04-18-2019 02:32 AM

Hi Leonardo,

 

as soon as you place a Wait in each of your subVIs to make them non-greedy you get your expected result…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 5 of 6
(57 Views)

Thanks  all 

0 Kudos
Message 6 of 6
(47 Views)