Default Sizes and Values of Arrays
- Updated2025-03-11
- 2 minute(s) read
Default Sizes and Values of Arrays
You cannot limit the size of an array to a fixed number of elements. However, when you set the default values of an array control, you can set the default size. You set the default values and array size when you create the array control.
Configuring an Array Control for Use in a VI
An array shell without a data object is undefined and has no data type. The VI will remain broken until you assign a data type by placing a control or indicator in the array shell.
When you place a control or indicator in the array shell, the empty array assumes the data type of the control or indicator. After you assign a data type to an array, you can use it in a VI regardless of whether the array is empty. The length of the empty array is 0, and the array elements are dimmed. You might place an empty array in a top-level VI that calls a subVI to populate the array.
For example, the following image displays an empty array shell about to receive a numeric data type.

Default Value Types of an Array
A front panel array control has the following two default values:
- Default value for defined elements– This value is the value of the array when the VI is loaded and is similar to the default value of any other front panel control. The values of the elements in the array compose the default value. The default array value also provides subVIs with a value when the calling VI does not specify a value for the array.
- Default value for undefined elements– This value is used to pad the array when the array expands. For example, if you set the array index beyond the defined portion of the array and enter a value for an undefined element, the elements between the defined portion of the array and the new elements you define are set to the default value for undefined elements.