Call by Reference
- Updated2023-02-17
- 4 minute(s) read
Call by Reference
Calls the VI to which a strictly typed VI reference refers. Like most diagram objects, Call by Reference executes synchronously, preventing data flow from continuing along its output wires until the referenced VI finishes executing. To run the referenced VI asynchronously while the diagram beyond the VI call continues executing, use Start Asynchronous Call instead.


reference in
The reference associated with a VI that is already open. The reference must be a strictly typed VI reference.

error in
Error conditions that occur before this node runs.
The node responds to this input according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
| error in does not contain an error | error in contains an error |
|---|---|
| If no error occurred before the node runs, the node begins execution normally.
If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out. | If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out. |
Default: No error

reference out
Unchanged reference associated with the strictly typed VI reference.

error out
Error information.
The node produces this output according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
| error in does not contain an error | error in contains an error |
|---|---|
| If no error occurred before the node runs, the node begins execution normally.
If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out. | If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out. |
Using a VI Reference Instead of a SubVI
Both Call by Reference and the subVI node call a VI. With Call by Reference, you can dynamically call any VI whose connector pane matches that of the strictly typed reference input. Use Open VI Reference or Static VI Reference to obtain a strictly typed reference. With a subVI node, you can call only a specific VI that is statically determined when you place the subVI node on the diagram.Accessing Inputs and Outputs of the Referenced VI
When you wire a strictly typed VI reference to the reference in input of Call by Reference, the node automatically displays the input and output parameters of the referenced VI. Wire data to the input terminals of Call by Reference to pass the data to the referenced VI. Use the output terminals of Call by Reference to access the data that the referenced VI returns.