Create/Update Custom Data Type from CVI Struct Dialog Box
- Updated2024-10-09
- 3 minute(s) read
Create/Update Custom Data Type from CVI Struct Dialog Box
Click the Create/Update Custom Data Type button located next to a parameter in the Type column on the Parameters Table on the LabWindows/CVI Module tab to launch the Create/Update Custom Data Type from Struct dialog box. This dialog box is available only for struct and struct array parameters.
Select the Create a New Type radio button to create a new TestStand type. When creating a new custom data type, the Create/Update Custom Data Type from Struct dialog box contains the following options:
- Type Name —The name of the new custom data type.
-
Struct Member List Box
—Includes the following information:
- C Label —The name of the struct member specified in the LabWindows/CVI code module.
- TestStand Name —The name associated with the field in the TestStand type. You can customize the property name.
- C Type —The type of the struct member in the LabWindows/CVI code module.
- TestStand Type —The type associated with the field in the TestStand type.
- Create Custom Data Type In File —The location where TestStand creates the new data type. By default, TestStand creates the new data type in the current sequence file.
Select the Update an Existing Type radio button to update an existing TestStand type. When updating an existing custom data type, the dialog box contains the following options:
- Type Name —The name of the new custom data type.
-
Struct Member List Box
—Includes the following information:
- C Label —The name of the struct member specified in the LabWindows/CVI code module.
- TestStand Name —The name associated with the field in the TestStand type. You can customize the property name.
- C Type —The type of the struct member in the LabWindows/CVI code module.
- TestStand Type —The type associated with the field in the TestStand type.
- Struct Mapping Action —The action to take to update the field in the TestStand type. If the struct field has been removed, you can delete the property from the TestStand type or exclude it from struct passing.
- Create Custom Data Type In File(s) —The locations of the custom data types to be updated.
Struct Import Behavior
Review the following import behaviors when importing structs from LabWindows/CVI.
- LabWindows/CVI enum struct members are mapped to TestStand numbers with 32-bit signed integer struct passing.
- Generally, struct member pointers to numeric types are mapped to TestStand array properties. By default, the array contains a single member. Leave the array length as-is to pass a single value by reference or pass an array of length one. (These two scenarios are equivalent in C.) Change the array length as needed to pass longer arrays. Make the array empty to pass a null pointer.
- Struct member IUnknown pointers, IDispatch pointers, and CAObjHandle are mapped to TestStand object reference types with appropriate struct passing settings. Pointers to void are mapped to TestStand numbers with struct passing settings appropriate to the size of the pointer: 32-bit unsigned integer in 32-bit TestStand and 64-bit unsigned integer in 64-bit TestStand.
- Struct member arrays of char and pointers to char are mapped to TestStand strings. TestStand sets the string buffer size to match the size of embedded character arrays. By default, TestStand sets the string buffer size for non-const string pointers to 1024. You must update this setting as appropriate for the code module.
- The Create Custom Data Type from Struct dialog box does not support struct members that are themselves structs.