Insert Into Array Function

Owning Palette: Array VIs and Functions

Requires: Base Development System

Inserts an element or subarray into n-dim array at the point you specify in index.

When you wire an array to this function, the function resizes automatically to display index inputs for each dimension in the array. If you do not wire any index inputs, the function appends the new element or subarray to the end of the n-dim array. If the index input is larger than the array size, the function does not insert anything into the input array.

Details  

 Add to the block diagram  Find on the palette
n-dim array is the array in which you want to insert an element, row, column, page, and so on. This input can be an n-dimension array of any type.
index 0..n-1 specifies the point in the array at which you want to insert the element, row, column, page, and so on. You can wire only one index input. For example, to insert a 1D array as the fourth row of a 2D array, wire 3 to the first index input, and the second index input becomes disabled. To insert the array as the fourth column of the 2D array, wire 3 to the second index input, and the first index input becomes disabled.
n or n-1 dim array is the element, row, column, or page you want to insert into the array specified in n-dim array.
output array is the array this function returns with the inserted element(s), row(s), column(s), or page(s).

Insert Into Array Details

Note  The base data type of the new element or array must be the same type as the input array. For example, if the input array contains Boolean control references, then the new element must be a Boolean control reference. Use the To More Generic Class function when you create the input array if you want to insert more generic elements into the array.

This function resizes the array along only one dimension. Therefore, you can wire only one index input. The index you wire determines the dimension along which you can insert. For example, to insert row(s), wire the row index, or to insert column(s), wire the column index.

The array you wire to n or n-1 dim array must be the same dimension or a dimension less than the one you wired to n-dim array. For example, you cannot insert a single element into a 2D array, and you cannot insert a single row (a 1D array) into a 3D array. You can, however, insert a 2D array that has a single row into a 3D array. LabVIEW pads the resulting array as necessary.