Enumeration Parameters - LabVIEW VI Call Parameters
- Aktualisiert2025-07-21
- 3 Minute(n) Lesezeit
Enumeration Parameters - LabVIEW VI Call Parameters
Enumeration Parameters
TestStand 2016 and later recognizes LabVIEW enumerated parameters as a distinct type, Enumeration . When you select an enumerated parameter, the Value column of the VI Parameter Table on the LabVIEW Module tab displays a combo box from which you can select elements of the enumeration. The Type column in the Module tab will indicate Enumeration (<numeric representation>) for all enumerated parameters.
At edit time, TestStand stores the numeric value and the corresponding string label value of the enumeration you select.
When you pass an enumeration value as a parameter to TestStand at run time, TestStand stores only the numeric value. In addition, for input parameters at run time, TestStand passes the numeric value to LabVIEW without checking whether the numeric value is within range .
In addition to the existing behavior, Enumeration types in TestStand support specifying a TestStand Enum data type variable/expression in the Value column.
You can create an Enum data type that maps to the LabVIEW enumerated parameter by clicking on the
Create/Update Custom Data Type
button located in the Type column of the VI Parameter table next to any LabVIEW enumerated parameter or an enumerated array parameter.
This action launches the
Create/Update Custom Data Type from Enum
dialog box, where you can create a custom Enum data type or update an existing Enum data type to match the LabVIEW parameter. You can then create an instance of the Enum data type and specify that variable in the Value column of the VI Parameter table.
When specifying Enum, String, or Numeric variables as the value of an enumerated parameter, the following table describes the behavior:
| TestStand Type | Variable passed to a LabVIEW input parameter | Variable receiving data from a LabVIEW output parameter |
|---|---|---|
| Custom Enum data type |
The elements of a TestStand Enum data type should match the LabVIEW parameter’s enumerated elements exactly (name, case and value). Any mismatch will result in an edit-time error. If a TestStand flag enum is passed to a LabVIEW ring parameter with a floating point representation (Double, Extended, or Single precision) it will result in an error at edit-time and run-time. Every enumerator specified in the TestStand enum value should have a matching enumerator in the LabVIEW enum. Flag enums can have multiple enumerators combined together with an OR operator. The numeric value of the TestStand enumerator should match the numeric value of the corresponding LabVIEW enumerator. If there are multiple flags combined with an OR operator, as in the case of a flag enum, their combined numeric value should match in TestStand and LabVIEW.If the numeric representation of the TestStand Enum doesn’t match the LabVIEW Enum or Ring control, you will get a run-time error in all cases. |
The elements of a TestStand Enum data type should match the LabVIEW parameter’s enumerated elements exactly (name, case and value). Any mismatch will result in an edit-time error. If a TestStand flag enum is passed to a LabVIEW ring parameter with a floating point representation (Double, Extended, or Single precision) it will result in an error at edit-time and run-time. If the numeric representation of the TestStand Enum doesn’t match the LabVIEW Enum or Ring control, you will get a run-time error in all cases. |
| String | If the variable’s value exactly matches any of the LabVIEW enumerated parameter’s elements, the numeric value of the element is passed to LabVIEW. If there is no match, you will get a run-time error.Assigning a duplicate enumerator name (more than one element with the same name) will result in an error. | If the numeric value received from LabVIEW matches any of the enumerated parameter’s elements, then the matching element’s name is stored in the string. If the numeric value does not match any element, its string representation surrounded by angular brackets is stored.Assigning a duplicate enumerator value to the string variable will result in an error. |
| Number | The numeric value is passed to the LabVIEW Enum or Ring control. If the variable’s numeric representation doesn’t match that of the LabVIEW enumerator control, you will get a run-time error. | The numeric value of the LabVIEW Enum or Ring indicator is assigned to the TestStand number. If the variable’s numeric representation doesn’t match that of the LabVIEW enumerator control, you will get a run-time error. |
See Also
LabVIEW Data Types in TestStand
Normalizing Numeric Values You Pass to Enumeration Parameter Values