Array Parameters - LabWindows/CVI Call Parameters
- Updated2025-07-21
- 2 minute(s) read
Array Parameters - LabWindows/CVI Call Parameters
Array Parameters
When you select the Array of Numbers, Array of Strings, Array of Enumerations, Array of Objects, or Array of C Structs categories for a parameter, the LabWindows/CVI Adapter displays controls similar to the controls for the Numeric, String, Enumeration, Object, or C Struct categories. You can specify an array that contains elements of the specified type, and TestStand reformats the contents of the array argument into a temporary array that contains elements that have the data type you select.
Use the Dimensions and Dim N Size controls to specify the number of dimensions and the number of elements in each dimension of the temporary array.
One-Dimensional Arrays
If the array argument has fewer elements than the temporary array, the LabWindows/CVI Adapter fills the remaining elements in the temporary array with zeros. If the array argument has more elements than the temporary array, TestStand fills the temporary array with the maximum number of elements that can fit.
For one-dimensional arrays in which you want the number of elements in the temporary array to always match the number of elements in the array argument, specify a negative value in the Dim N Size control. This specification is equivalent to the following expression:
GetNumElements (arrayArgument)
If you specify a zero value in the Dim N Size control, TestStand passes the address of the temporary array with no elements to the DLL function. When the DLL function returns, TestStand cannot fill the contents of the array argument with the contents of the temporary array because the array size is zero.
If the array argument has fewer elements than the temporary array, TestStand only stores the number of elements from the temporary array that fit into the array argument. If the array argument has more elements than the temporary array, TestStand stores all the elements of the temporary array in the array argument and makes no changes to the remaining elements of the array argument.
Multi-Dimensional Arrays
For multi-dimensional arrays, the dimension sizes of the array argument must match the specified number of elements in the Dim N Size control.
If you select the Array of C Structs category, the LabWindows/CVI Adapter displays the Element Pass control. If you select Embedded Element , TestStand creates an array of C structures and passes the array to the DLL function. If you select Pointer to Element , TestStand creates an array of C structures and passes the array of pointers to the DLL function.
See Also
Accessing Arrays Using API from LabWindows/CVI Code Modules (Example)