LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stopping a subvi without stopping the whole program

I am using a subvi in a larger program. So I use the STOP application control. However, stop stops the entire program -- not just the subvi.

Now how do I stop the subvi without stopping the rest of the program?
0 Kudos
Message 1 of 2
(2,613 Views)
I am assuming that the larger application has a "large" loop somewhere where the sub-vi is called more than once, right?

Ever thought of placing the sub-vi in a Case Statement with a Bolean Local Variable that feeds the Case Statement? This way, you can initialize the Case Statement to TRUE and run the sub-vi as you normally would. You can change the value to FALSE anywhere in your code if a certain even or condition is met (within other(s) Case Statements) and that way the sub-vi will not run and you do not have to stop the whole code.

You can even wire the Case Statement containing the sub-vi to a "STOP/PAUSE" button in your front panel, that way you can manually control whether the sub-vi is run or not.

Many options. Experiment with Local Vari
ables.
Right click the bolean icon, select "Create" and choose "Local Variable". You can then feed the TRUE or FALSE into the local variable which will set the input to the Case Statement.

JLV
Message 2 of 2
(2,613 Views)