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: 

How to close a running vi?

I am trying to close the vi from within itself, the "exit labview" subvi doesn't seem to help, any ideas why?
0 Kudos
Message 1 of 3
(3,121 Views)
It should work unless you've wired a Booleand false value to the input. Leave the input unwired or make it a true value in order to exit. If you don't have a false value wired to the input, attach your VI so someone can look at it. Maybe the function isn't being called when you stop the VI.
0 Kudos
Message 2 of 3
(3,121 Views)
Hi,
The VI that you are testing would be useful. Make sure that the peace of code where Quit LabVIEW function does get executed. Maybe you have it in a loop that doesn't get called because of some other process. Or you have it outside of a loop that doesn't exit until you stop the VI.
If you just want to stop a VI, and not have to close LabVIEW, you should use methods and properties of that VI. For example, Close After Call method will not abort the VI but will close its windows.
You can also change the window appearance, under VI Properties, so that the front panel window gets closed after the VI is done executing.
The attached VI makes sure that you properly close a VI.
This example enables a VI to detect when you are attempting to improperly close
the VI using the close box, system menu, or Alt+F4. It then executes LabVIEW code to properly shutdown the VI or cancels the exit command. Normally, VIs simply abort if the close box is clicked. The VIs included in this example will only work on 32-bit Windows systems.
As of LabVIEW 6.1 this functionality is incorporated into the Event Structure as a VI and/or Application Level Event.

Zvezdana S.
National Instruments
0 Kudos
Message 3 of 3
(3,121 Views)