05-29-2009 08:41 AM
Recently Mark Ridgley posted an example program of how to quit LabVIEW if and only if no other VIs were active in memory (see document here: http://decibel.ni.com/content/docs/DOC-4086). I like his approach, but my needs were slightly different.
I only wanted to quit LabVIEW if the VI was running inside an executable (that is to say - never quit the development environment).
The result uses a case structure and a VI Server Property Node to determine if the current execution system is a built application or the development environment.
Mark's approach has an elegance that my solution makes up for with brute force. Meaning if you are using dynamically loaded VIs, or if any other VI is running in the .EXE at the time this VI is called, they will be shut down.
Perhaps someone wants to create a hybrid which will quit only from a built EXE IFF no other VIs are in memory.
09-02-2013 05:07 PM
You can use a Conditional Diagram Disable Structure with the variable Run Time Engine instead of using the property node. It is a little more efficient and a lot cleaner for the compiler. Further, I also suggest closing the front panel instead of using the Quit LabVIEW. This is much better cleanup process for the LabVIEW RTE.