Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Default Sizes and Values of Arrays

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

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.

Do not make the default size of the array larger than necessary. If you set a large default size for an array, the default data for each element of the array saves with the VI and increases the size of the VI on disk.

An array shell without a data object is undefined and has no data type. You cannot use such an array in a VI 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 array assumes the data type of the control or indicator. The length of the empty array is 0, and the array elements are dimmed. After you assign a data type to an array, you can use it in a VI regardless of whether the array is empty. You might use an empty array in a VI that will later be used by a subVI that populates the array.

A front panel array control has two default values—an array default value and a scalar default value.

The array default value is like the default value of any other front panel control. It is the value of the array when the VI is loaded. It also is used for an array in a subVI when the calling VI does not wire a value.

The scalar default value is the value 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 to an element, the elements between the previous end of the array and the element you added are set to the scalar default.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit