Call By Reference

Calls the VI specified by reference. The reference VI must be a strictly typed VI reference.


icon

Inputs/Outputs

  • cvirn.png reference

    reference is the refnum associated with a VI that is already open.

    The reference must be a strictly typed VI reference.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • ivirn.png reference out

    reference out returns reference unchanged.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • Both the Call By Reference node and the subVI node call a VI. The Call By Reference node enables you to call any VI dynamically whose connector pane matches that of the strictly typed reference input. Use the Open VI Reference function to obtain a strictly typed reference. A subVI node only allows you to call a specific VI that is statically determined when you place the subVI node on the block diagram.

    Interface Details

    The interface of this node includes the following features:

    • Accessing inputs and outputs of the target VI—When you wire a strictly typed VI reference to the reference input of the Call By Reference node, the node displays the connector pane of the referenced VI. Wire data to the input terminals of the connector pane to pass the data to the called VI. Use the output terminals of the connector pane to access the data that the called VI returns.
    • Changing the connector pane of a wired Call By Reference node—To force the Call By Reference node to display a different connector pane after you change the reference input, right-click the node and select Adapt To Reference Input from the shortcut menu.

    Execution Details

    This node exhibits the following execution behaviors:

    • Synchronous execution—Like most block diagram objects, the Call By Reference node executes synchronously, preventing data flow from continuing along its output wires until the target VI finishes executing. If you want to run the target VI asynchronously while the block diagram beyond the VI call continues executing, use the Start Asynchronous Call node instead.
    • Performance overhead for calling a VI dynamically—The overhead for calling a VI by reference in the local application instance is negligible compared to the overhead of using a subVI node. LabVIEW requires significantly more overhead to call a VI by reference in a remote application instance.

    Alternative Ways to Call a VI

    The Call By Reference node is not the best choice for dynamically calling a VI in the following circumstances:

    • Asynchronous execution—If you want to call a target VI asynchronously, use the Start Asynchronous Call node instead of the Call By Reference node.
    • Opening the front panel of a target VI without running the VI—If you want to open the front panel of a target VI without causing the VI to run, use the Front Panel:Open method instead of the Call By Reference node.