Chapter 14
Arrays, Clusters, and Graphs
©
National Instruments Corporation
14-11
if
element
is a long integer with the value of five and
dimension size
has a value of 100, the result is a 1D array of 100 long integers all set to
five. You can wire the inputs from front panel control terminals, as shown
in the preceding illustration, from block diagram constants, or from
calculations on other parts of your diagram.
To create and initialize an array that has more than one dimension, pop up
on the lower-left side of the function and select Add Dimension. You also
can use the Resizing cursor to enlarge the Initialize Array node and add
more dimension size inputs, one for each additional dimension. You can
remove dimensions by shrinking the node by selecting Remove Dimension
from the function pop-up menu or with the Resizing cursor.
The following block diagram shows how to initialize a 3D array.
If all the dimension size inputs are zero, the function creates an empty array
of the specified type and dimension.
Array Size
Array Size returns the number of elements in the input array.
4
7
3
2
5
Array
Size = 4 Elements