LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting - Terminal Information

Solved!
Go to solution

Hello, I am attempting to wire up several inputs to a function (array index), and the output from that function to another terminal.  When referencing the terminals of that function, the output is an array and I have no idea what values to choose in order to connect things to the terminals of a function.  Is there some way to determine these values?  I have looked over a scripting example and they show a simple add function, but it's not clear where they are coming up the indices for the terminals:

NI_User_11108_0-1683403944160.png

In this example, how do I know how to work with the array for the 'Wire Source' connections?

0 Kudos
Message 1 of 3
(763 Views)
Solution
Accepted by topic author NI_User_11108

It depends on the sub-class of the Node you want to wire:

 

1. For a Function or a SubVI, if you go in Options -> VI Server -> VI Scripting -> check "Display additional VI Scripting information in Context Help window", you will be able to see the terminal indexes (which can be used to index the Terminals[] property of the Node class).

 

Here with the "Add" function:

raphschru_1-1683416508548.png

 

Here with the "Write Delimited Spreadsheet" SubVI:

raphschru_1-1683413859374.png

 

 

2. For a GrowableFunction, you don't have these infos, but certain specific sub-classes may have additional properties to help you in the scripting. For example the class "IndexArray" has properties "Array Input Terminal", "Index Count", "Index Terminals[][]" and "Output Terminals":

 

raphschru_2-1683414558944.png

 

 

3. For other Nodes that don't have a specific class or not enough information about the terminal you want to wire, you will have to investigate using the terminal properties. Here is an example with a Property Node:

 

raphschru_5-1683417620935.png

 

So you can deduce that terminals 0, 1, 2, 3 are respectively ref in, ref out, error in, error out, then terminals 4 to n-1 are the property item terminals.

 

Finally, if the name of the terminal is not sufficient to determine its index (e.g. when several terminals have the same name), you can also use the properties "Is Source?" or "Data Type".

Message 2 of 3
(726 Views)

Thanks!  Excellent breakdown on how to go about getting this information.

0 Kudos
Message 3 of 3
(719 Views)