Run VI

Starts the VI execution, similar to the Run button. This method is different than calling a VI because it uses the current values of all front panel controls for execution rather than using data passed in through parameters. This method also ignores the Execution:Show Front Panel On Call property of a VI and the Execution:Close After Call property.

Note This method requires the VI to have a front panel. If you are using the Application Builder, make sure you do not remove the front panel.

You cannot use this method to run a VI that is already reserved for execution by another VI.

If you use the Open VI Reference function and wire the type specifier VI Refnum input, you cannot use the reference returned by the function with this method. Instead, you must use the Call By Reference node.

If you want to use this method with a reentrant VI, set the options parameter to 0x08 in the Open VI Reference function to prepare the VI for reentrant run.

Parameters

Name Data type Required Description
Wait Until Done cbool.png No
Specifies whether to wait until the VI completes execution before the Invoke Node continues executing. The default is TRUE.
Tip Use the Start Asynchronous Call node instead of the Run VI method to run target VIs asynchronously. In addition to providing a simpler interface, the Start Asynchronous Call node allows you to collect the outputs of the target VI with a corresponding Wait On Asynchronous Call node.
Auto Dispose Reference cbool.png No
Allows you to run a VI independently of the caller without opening its front panel immediately or opening another reference inside the target VI. If TRUE, the referenced VI transfers ownership of the reference from the calling VI to the VI that is running. This means LabVIEW disposes of the reference, along with the parallel data space, when the target VI goes idle, not when the VI that opened the reference goes idle. The reference can still be used by the calling VI until the target VI closes the reference. The calling VI does not need to close the reference unless the Run VI method returns an error. If the calling VI does close the reference, the target VI can abort and leave memory. If FALSE, LabVIEW automatically disposes of the VI reference when the VI that opened it goes idle. The default is FALSE.
Note If Auto Dispose Ref is TRUE and the method returns an error, LabVIEW does not transfer ownership of the reference to the target VI. LabVIEW will not automatically dispose of the reference when the target VI goes idle.

Remarks

The following table lists the characteristics of this method.

Short Name Run VI
Data type No return value
Available in Run-Time Engine Yes
Available in Real-Time Operating System Yes
Settable when the VI is running Yes
Loads the front panel into memory No
Need to authenticate before use No
Loads the block diagram into memory No
Remote access allowed Yes
Must wait until user interface is idle Yes
Available with control VIs No
Available with global VIs No
Available with strict type definitions No
Available with polymorphic VIs No