VI.Fake Exec State

From LabVIEW Wiki
Jump to: navigation, search

VI.Fake Exec State is a private method. It is used to make a VI appear to start or stop running without actually starting or stopping it. A VI that is fake-stopped in this way can be edited, including through VI Scripting. Clicking the Run arrow on a VI in this state will not restart the VI, but merely "remind" LabVIEW that it is actually running, allowing it to be stopped. If a non-running VI is fake-started using this method, it will become impossible to start or edit the VI until the method is called again with the actual execution state, as clicking the Stop button will have no effect.


VI.Fake Exec State requires a single I32 value. As stated in its context help, using 1 will make the VI appear to be running, and using 2 will make the VI appear to be stopped, regardless of its actual state.
This method does not return anything.

Example usage

Fake Exec State.png

Drag this VI Snippet into a VI. An LED indicator should appear on the front panel. Click the Run arrow, and the VI will appear to stop running immediately, but the LED will continue blinking.

One real use this method can have is when testing things with scripting. If you want to just get a feel for how a certain method or property works, for example, you can wire 2 to Fake Exec State to test it in the same VI. This way you won't need to open a new VI. Keep in mind, however, that as with any private property or method, this is only to be used for experimentation like this, and is 100% unsupported by National Instruments, so don't use it for anything important.