Struct Parameters - .NET Call Parameters
- Updated2025-07-21
- 2 minute(s) read
Struct Parameters - .NET Call Parameters
Struct Parameters
You can pass struct parameters using the .NET Adapter in any of the following ways:
- You can store and pass struct parameters using TestStand object reference variables. Use this approach to store the actual .NET struct in the object reference, which can improve speed and efficiency because TestStand does not need to convert the struct to a TestStand variable type. However, you cannot directly access the data from TestStand without using additional .NET calls.
- You can create a TestStand custom data type that matches the structure of the .NET struct. Click the Create Type from Struct button on the .NET Module tab of the Step Settings pane in the TestStand Sequence Editor or on the Module tab of the Edit .NET Call dialog box in a TestStand User Interface to launch the Create Custom Data Type from Struct dialog box to create the custom data type. You can then create TestStand variables of the custom data type and pass the variables as arguments for parameters of the .NET struct type. Use this approach to see and use all the fields of the struct directly in TestStand as native TestStand variables. However, this approach has greater overhead than using object reference variables because the .NET Adapter must copy the fields between the .NET struct and the TestStand custom data type variable.
- You can specify individual TestStand variables to store and pass each field of a .NET struct. Expand the struct parameter in the Parameters Table on the .NET Module tab of the Step Settings pane in the sequence editor or on the Module tab of the Edit .NET Call dialog box in a user interface to specify individual fields. Use this approach to store one or more fields directly in TestStand variables and use them from TestStand without having to create a TestStand custom data type and to use each field separately. However, this approach is less efficient than using object reference variables or custom data types.
See Also
Create Custom Data Type from Struct dialog box
.NET Struct Passing tab on the Type Properties dialog box