LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I force end my 'End Application' While Loop?

I understand that the inner while loops in the program must finish executing until condition is met.But right now,I have a huge while loop to end the application but it doesn't stop LabVIEW from executing. Do note that i have tonnes and loads of other SubVIs within the same VI. Must I really go down into it and create a local variable 'End Application'? That'll be tedious ....... 😞
0 Kudos
Message 1 of 4
(5,117 Views)
You can wire the application.kind property for the application VIServer class to a case statement in which the 'Stop' primitive is in the "Development,default" case and and the 'Quit Labview' primitive is in the "Run Time System" case. (Caution: Quit Labview will exit LabView completely in the Development system if encountered, but this may be the behavior you seek) This can be done in a common subvi that is called wherever you want but I don't believe this is generally considered good dataflow programming.
0 Kudos
Message 2 of 4
(5,117 Views)
Generally, you want some sort of control over what happens when the user presses Stop. Using the Stop or Quit LabView functions abort anything LabView's doing (more or less instantly). The more complicated your program, the more likely you want a controlled stop to get to a known state. Saving results, closing files, shutting down power to Unit Under Test are part of a long list of things you might want to do before stopping.

So you may need to use local variables for a Stop button checked in multiple locations. If you have sub-VIs running which run loops, you may need to use a global rather than a local to check Stop in the sub-VIs.

You may not need to check Stop in as many locations as you think. Start with the long running loops and sub-VIs and see if your
Stop is fast enough without checking Stop everywhere.
0 Kudos
Message 3 of 4
(5,117 Views)
Thanks guys, your answers really solved my problem. Didn't know that there was the LabVIEW function 'STOP', thanks once again.

Zeus bless you all with good health and wealth! 🙂
0 Kudos
Message 4 of 4
(5,117 Views)