From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching multiple subvi back and forth in Subpanel whithout closing them

Solved!
Go to solution

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
(2,215 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,211 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
(2,178 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.

Download All
0 Kudos
Message 4 of 6
(2,155 Views)
Solution
Accepted by Leonardo111

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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 6
(2,147 Views)

Thanks  all 

0 Kudos
Message 6 of 6
(2,137 Views)