Table Of Contents

Index Array (Clock-Driven Logic)

Last Modified: August 28, 2017

Returns the value stored in an array at a specified index.



An n-dimensional array of any type.

If array is an empty array, element returns the default value of the defined data type for the array.



A number that refers to a location within the input array.

This node automatically provides an index input for each dimension of the array.

Behavior for Out of Range Values

If the index is less than zero or greater than the length of array in this dimension, this node returns the default value of the defined data type for the array.

Which Index Refers to Which Dimension?

Array nodes in LabVIEW access array data in row-major order. In a 2D array, row is the first, major index. Column is the last, minor index. In bigger multidimensional arrays, column remains the last index and the more major indexes are added to the front. Thus, vol is the first index, followed by page, row, and column. These names are index identifiers and have no other meaning.

Unwired Index Inputs

Unwired index inputs allow you to retrieve a subarray of the array rather than a single element. For example, to retrieve column 1 of a 2D array, specify 1 in the column index and leave the row index unwired.

How Does index Relate to Multiple element or subarray Outputs?

If you expand the node to show more than one element or subarray output, LabVIEW provides a set of index inputs for each output. The values you wire to a set of index inputs determine the value of the corresponding output. However, if you do not wire values to a set of index inputs, the corresponding element or subarray output returns the element or subarray that follows the previous element or subarray output in the original array. Refer to the Examples tab for an illustration of this relationship.

Default: 0



The value stored in array at the specified index. This output is the same type as the elements of array.

Resizing Behavior

When you wire an array to this node, the node resizes automatically to display index inputs for each dimension in the array you wire to array. You also can add additional element terminals by resizing the node.

Accessing a Subarray by Disabling Indexing along a Dimension

You can disable indexing along a dimension by leaving the corresponding index input unwired, unless you are indexing a 1D array. By default, the first dimension has indexing enabled, with the others disabled. You can wire a constant or control to the index inputs that you want enabled.

For example, if you want to index a row in a 2D array, the first index input is enabled and the second index input is disabled. If you want to index that same 2D array also by column, you can resize the function to show another set of input terminals. This next set of inputs has its own corresponding element output. By default, if you do not wire any index input terminals, the first element indexes row 0, the second element indexes row 1, and so on.

Where This Node Can Run:

Desktop OS: none

FPGA: All devices

Web Server: Not supported in VIs that run in a web application

Recently Viewed Topics