Creating an Enumeration Data Type and Defining the Enumerators
- 更新时间2025-03-28
- 阅读时长1分钟
To create a TestStand enumeration, go to the Types View in the TestStand Sequence Editor. In a sequence file of your choosing, go to Custom Data Types and right click to insert a type. From the context menu, select Insert Custom Data Type and choose Enumeration. Name the newly created data type Color, for example. Note that the current state of the type Color is {Invalid} [] (0). The Color type currently has no enumerators, so its default value is invalid. This is one example of how a TestStand enumeration can end up in an invalid state.
Click the Edit Enumerators button next to Color to launch the Edit Enumerators dialog box.In the table control, define the following three enumerators:
Red | 255 |
Blue | 65280 |
Green | 16711680 |
Click OK to commit these changes and close the dialog box. Notice that Color is no longer invalid and has a default value of Red. The underlying numeric value of 255 is displayed in parentheses for convenience.
Since hexadecimal is more convenient for this example, change the numeric format. Right click on the type definition. In the context menu, choose Numeric Format to launch the Numeric Format dialog box. Change the type to Hexadecimal and click OK. Note that the number in parentheses is now displayed in hexadecimal format.