Run VI Method

LabView Local Project Settings

Run VI Method

Short Name: Run VI

Installed With: Base Package

Class: VI Methods

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.

Example

Parameters

NameRequiredDescription
Wait Until DoneNoSpecifies whether to wait until the VI completes execution before the Invoke Node continues executing. The default is TRUE.
Auto Dispose RefNoAllows 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.

Available in Run-Time Engine and Real-Time Operating SystemYes (Read/Write)
Settable when the VI is runningYes
Loads the front panel into memoryNo
Need to authenticate before useNo
Loads the block diagram into memoryNo
Remote access disallowedNo
Must wait until user interface is idleYes
Available with control VIsNo
Available with global VIsNo
Available with strict type definitionsNo
Available with polymorphic VIsNo

Example

Refer to the DateServerUsingReentrantRun VI in the labview\examples\viserver\runvi.llb for an example of using the Run VI method.

 Open example  Browse related examples