You navigate from a node to a wire any time that you use a reference to a node to obtain a reference to a connected wire. Navigating from a node to a wire is a navigation subtask that you can combine with other navigation subtasks to accomplish larger navigation goals. Refer to the navigation overview to learn more about how navigating from a node to a wire interacts with other navigation tasks.
What to Use
This VI Scripting task requires the following objects:
Before you start: Open the Navigating Nodes and Wires VI in the labview\examples\Application Control\VI Scripting\Finding and Modifying Objects directory for an example that illustrates each step of the following procedure.
Open Example
Expand the procedure for more information about this specific example.
In the example, the scripting VI uses the Traverse for GObjects VI to obtain references to all the Function nodes in the target VI. The Case structure checks the style of each Function node so that navigation continues only from the Function nodes whose style is One Button Dialog.
Use the Node:Terminals[] property to obtain references to the terminals of the node.
Example Details
In the example, the Node:Terminals[] property appears as Function:Terminals[] because the reference is a Function reference. Because Function is a subclass of Node, Function inherits the Terminals[] property of Node.
Refer to the Context Help window of the node to identify the terminal index of the terminal that connects the node to the destination wire.
You must display additional VI scripting information in the Context Help window to cause the connector pane in the Context Help window to display a bracketed number next to each terminal. This number represents the index in the Terminals[] array where the reference to the corresponding terminal is stored.
Example Details
In the example, the scripting VI requires the index of the button name input of the One Button Dialog function. According to the Context Help window for the One Button Dialog function, the index for that input terminal is 1.
Use the Index Array function with the desired terminal index to obtain a reference to the desired terminal in the Terminals[] array.
Use the Terminal:Connected Wire property of the returned terminal reference to obtain a reference to the wire connected to that terminal.
Use the returned wire reference to either modify the wire or to continue navigating.
Beware of invalid references in the Node:Terminals[] array—The Node:Terminals[] array contains one element for every terminal of a Node. However, each element is a valid reference to a terminal only if the terminal is wired. Because many VIs and functions have optional inputs that are not always wired, the array of terminals often contains invalid references for these terminals. Therefore, if you are not sure whether a specific terminal is wired, check the corresponding element in the terminals array to see if it is an invalid reference before attempting to use it elsewhere in a scripting VI.
Close all references that you open—An excessive number of open references negatively impacts the performance of a VI. Read about closing VI and object references for more performance details.
Additional Examples
Refer to the Navigation Overview VI in the labview\examples\Application Control\VI Scripting\Finding and Modifying Objects directory for a complete navigation example that includes navigating from a node to a wire and navigating across a structure.