Eventually when you build an EXE from your VI's, you require the ability to enable, disable or switch certain sections of your code so that it behaves differently as an executable. In order to do this however you need to somehow determine if you're in executable mode. The following method describes the creation of a VI that will give you this information.
The mode that LabVIEW is running in is available from the application property node as shown below:
This property node however should not be access repeatedly since it will introduce some overhead. A better way to cache this or any other information is via a shift-register global. This can be created using a while loop with a shift register.
We only need to read the information from the property note when this VI runs for the first time. We use the First Run? node available from the advanced pallete. We then take the output of the property node, which is an enumerated, and decode it to a boolean. The other case is shown below. We can safely ignore the other enumerated options in this example as we do not require them.
The boolean is then fed to a shift-register and in turn to the output. For all subsequent runs of this VI, the First Run? node will be false and so will execute the false case shown below which is just a pass through.
The front panel is very simple and contains only one boolean as seen below:
One thing to note about the First Run? node. If you run this VI stand-alone, the First Run? output will always show as true. This is because the VI is not reserved for execution by any other VI above it in the hierachy.
LV Version 6.0 VI's
Is_EXE.zip
Support or questions on this code should be done via the forums.