Using TestStand Enumerations - .NET
- Updated2024-11-26
- 2 minute(s) read
Using TestStand Enumerations - .NET
Purpose
This example shows how to use TestStand enumerations with .NET code modules. Enumerations are defined as custom types and can be stored in the Sequence File or Type Palettes.
Example File
Location
<TestStand Public>\Examples\Fundamentals\Using TestStand Enumerations\DotNet\Using TestStand Enumerations.seq
Highlighted Features
- Using Enumerations in TestStand
- Range Checking:Strict and Loose Enumerations
- Flags Enumerations and Bitwise OR Semantics
- Using Enumerations with the TestStand Adapters
Major API
- Val Function
- Str Function
Prerequisites
None
How to Use This Example
Complete the following steps to run the example:
- Select Execute»Run MainSequence to execute the sequence.
- As the example executes, follow the prompts and read the message popups for information about Enumerations, Strict Enumerations, and Flag Enumerations.
Complete the following steps to review the enumerations and steps in this example:
- Open the Enum sequence from the Sequences pane. Select the Enum Behavior step and review the step settings and parameter values for the step. This code module allows the user to select a combination of RGB colors, which are then stored in the Locals.Color Local variable.
- Select the Display Enum Value step and review the Message Expression. This expression uses the Str() and Val() functions to display the string and formatted numeric representations of an enum value.
- Repeat steps 1 and 2 for the Strict Enum and Flag Enum sequences.
- Open the Types Window (Ctrl + t) and select Enums.seq to view the three different enumeration definitions used in this example: Colors, Colors_Strict, and Colors_Flag. Choose Edit Enumerations to view details of each type.