Array Manipulation in Formula Nodes

Input arrays and input-output arrays take their type from the array to which they are wired. These arrays do not require you to declare them inside the Formula Node. However, you must declare local arrays and output arrays in the Formula Node.

Arrays are zero-based, as they are in C. Unlike C, LabVIEW treats an assignment to an array element that is out of range as a non-operation, and no assignment occurs. Also unlike C, if you make a reference to an array element that is out of range, LabVIEW returns a value of zero. You must declare array outputs in the Formula Node unless they correspond to an array input, in which case the two terminals must share a name.

If an input terminal is an array, you can use the following functions to determine the shape of the array.

numDim = numberOfDims(inputArr);

firstrowsize = sizeOfDim(inputtArr, 0);

Array Manipulation Example

Take a typical array declaration, such as

int16 a[4][7]

After declaring such an array, you can make assignments, such as

a[3][2]=455;

You also can use array elements in expressions, such as

a[0][5]=a[1][6]*3+a[5][0];