Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Static VI Reference Function

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Owning Palette: Application Control VIs and Functions

Requires: Base Development System

Maintains a static reference to a VI. You can configure the Static VI Reference function to output a generic or strictly typed VI reference. After you place the Static VI Reference function on a block diagram, double-click the function to display a file dialog box where you can select a VI.

Details  

vi reference is the refnum associated with the configured VI. If the VI is not valid, vi reference contains Not A Refnum.

Static VI Reference Details

The Static VI Reference function acts as a subVI and appears in the VI hierarchy of the top-level VI. By default, the output is a generic VI reference.

You can change the output of this function to a strictly typed VI reference. Right-click the function and select Strictly Typed VI Reference from the shortcut menu to change the output. A red star in the upper left corner of the function icon indicates the reference is strictly typed. The strictly typed VI reference identifies the connector pane of the VI you are calling. You can create a strictly typed VI reference only from a VI or VI template, not from a polymorphic VI or other non-VI file such as a global variable or control.

Use a strictly typed VI reference if you want to call the referenced VI with the Call By Reference node or the Start Asynchronous Call node. When you create a strictly typed VI reference, you cannot wire vi reference to the Run VI method. You cannot use the Run VI method to run a VI that is already reserved for execution by another VI. A strictly typed static VI reference also reserves any subVIs when a top-level VI is reserved, thus making it ineligible for the Run VI method. Refer to the Run VI method for more information.

LabVIEW loads the referenced VI into memory when you load the top-level VI. When the Static VI Reference function outputs a strictly typed VI reference, LabVIEW reserves the referenced VI as long as the top-level VI is running. LabVIEW closes this reference when the top-level VI is no longer in memory. You do not have to explicitly close the reference this function returns.

Note  LabVIEW does not check whether the referenced VI can compile. If the referenced VI is broken, LabVIEW does not recognize that it is broken until you run the top-level VI. If you execute an Open VI Reference function that references the broken VI, you receive an error.

If you want LabVIEW to check for a broken referenced VI before you run the top-level VI, use the referenced VI directly in the top-level VI instead of using a Static VI Reference function by clicking the Select a VI icon or text on the Functions palette and navigating to the VI you want to add to the block diagram.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit