Structure Parameters - LabWindows/CVI Call Parameters
- Updated2025-07-21
- 2 minute(s) read
Structure Parameters - LabWindows/CVI Call Parameters
Structure Parameters
You can pass variables and properties you create with named data types to function parameters that accept structures. When you create or edit a data type, you specify whether the type can be a C structure argument and how the type represents itself in memory when you pass it to a structure parameter . When you specify the data to pass for the struct parameter on the Module tab of the Step Settings pane, you only need to specify an expression that evaluates to data with the data type.
- You can pass NULL to a structure pointer parameter by passing an empty object reference or the constant Nothing . Do not pass the constant 0 .
- The LabWindows/CVI Adapter cannot call functions which specify structure parameters that contain pointers to memory that the function allocates or deallocates.
Type, and Pass by Value or by Reference
When you select the C Struct category for a parameter, the LabWindows/CVI Adapter displays the Type and Pass controls. The Type control specifies the TestStand named data type the adapter uses to determine how to pack the structure elements in memory. The Pass control specifies whether TestStand passes the value of the argument you specify in the Value Expression control or passes a pointer to the argument. If you select By Reference (by pointer) , the adapter passes a pointer to the argument value. When you pass a C struct by reference, a member of the C struct uses the CAObjHandle data type, and the function alters the value of the struct member, do not use the function to discard the original handle. TestStand discards the original handle after the call completes.
If you choose to pass a pointer, the argument you specify in the Value Expression control must be the name of a variable or property.