Description
Description-Separate-1This example shows you how to programmatically create an enumeration variable using the TestStand API.
Description-Separate-2How to Use
How-Separate-11. You should create a property object with value type Container using the NewPropertyObject Method:

2. Then define a name for the property object and the number of elements it will contain using the
Name Property and
SetNumElements Method:

3. After, you can populate the property object, each element in the container should have two sub properties: EnumeratorName and EnumeratorValue that you can add using the
NewSubPropery and
SetValString and
SetValNumber respectively methods:


4. You should create also a new data type using the
NewDatatType method and name it using Name Property:


5. By default, the data type is empty, to populate it you can use the
Update enumerators method passing the reference of the created container:


6. Finally, you can insert the enum data type in the type usage list of the current sequence file using the
InsertType method, use the
IncChange Count method required to indicate to the sequence editor or user interface that the file was modified and the
SaveFileIfModified method to save the changes in the sequence file.


7. To create a instance of the enum data type you can use the NewSubProperty method, for example to create a local variable:

Note: The LabVIEW (2019) code described in this document is provided as attachment.
How-Separate-2Additional Information
Additional-Separate-1If you are interested in creating a data type refer to Using the TestStand API to create a Data Type.
Additional-Separate-2Related Links
Related-Separate-1
Related-Separate-2