Enumeration Parameters - LabVIEW NXG VI Call Parameters
- Updated2025-07-21
- 3 minute(s) read
Enumeration Parameters - LabVIEW NXG VI Call Parameters
Enumeration Parameters
TestStand recognizes LabVIEW NXG Enum controls 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 NXG without checking whether the numeric value is within range.
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 NXG 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 NXG 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 NXG 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 NXG input parameter | Variable receiving data from a LabVIEW NXG output parameter |
|---|---|---|
| Custom Enum data type |
The elements of a TestStand Enum data type should match the LabVIEW NXG parameter's enumerated elements exactly (name, case and value). Any mismatch will result in an edit-time error. Every enumerator specified in the TestStand enum value should have a matching enumerator in the LabVIEW NXG 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 NXG 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 NXG.If the numeric representation of the TestStand Enum doesn't match the LabVIEW NXG Enum control, you will get a run-time error in all cases. |
The elements of a TestStand Enum data type should match the LabVIEW NXG parameter's enumerated elements exactly (name, case and value). Any mismatch will result in an edit-time error. If the numeric representation of the TestStand Enum doesn't match the LabVIEW NXG Enum control, you will get a run-time error in all cases. |
| String | If the variable's value exactly matches any of the LabVIEW NXG enumerated parameter's elements, the numeric value of the element is passed to LabVIEW NXG. 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 NXG 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 NXG Enum control. If the variable's numeric representation doesn't match that of the LabVIEW NXG enum control, you will get a run-time error. | The numeric value of the LabVIEW NXG Enum indicator is assigned to the TestStand number. If the variable's numeric representation doesn't match that of the LabVIEW NXG enum indicator, you will get a run-time error. |