UNS Enumerations (Reference) associate numeric tag values with descriptive text strings, enabling meaningful data presentation by displaying text instead of numbers in HMI displays.
Enumerations provide:
Enumerations transform raw numeric values into human-readable states like "Running/Stopped" or "Open/Closed".
| Property | Description | Required |
|---|---|---|
| Name | Enumeration set identifier | Yes |
| Value | Numeric value to map | Yes |
| Display Text | Text to show for value | Yes |
| Match | Matching criteria/condition | No |
| ActiveColor | Color when value matches | No |
| InactiveColor | Color when value doesn't match | No |
| Category | Classification group | No |
| Description | Documentation text | No |
The enumeration is assigned per instance: each tag carries its own, so one UserType (UDT) can be reused across screens with a different enumeration on each instance — including a different enumeration on an individual member of a UDT instance, set from the Tag Properties dialog via Edit Properties of member. See UNS Tags Reference → Per-instance enumeration override.
csharp
// Get numeric value
int value = @Tag.Motor1.Value; // Returns: 1
// Get enumeration text
string text = @Tag.Motor1.ValueAsString; // Returns: "Running"OnOff
| Value | Text | Use Case |
|---|---|---|
| 0 | Off | Equipment stopped |
| 1 | On | Equipment running |
OpenClosed
| Value | Text | Use Case |
|---|---|---|
| 0 | Open | Valve/breaker open |
| 1 | Closed | Valve/breaker closed |
ManualAuto
| Value | Text | Use Case |
|---|---|---|
| 0 | Manual | Local control |
| 1 | Auto | Automatic control |
EnumOpenedClosed
EnumLocalRemote
EnumPower
EnumTypeConnector
EnumNormIntermTransf
| Value | Text | Description |
|---|---|---|
| 0 | Normal | Standard operation |
| 1 | Intermediary | Transition state |
| 2 | Transferred | Alternate position |
EnumTicketColor
| Value | Text | Color | Priority |
|---|---|---|---|
| 0 | Red | #FF0000 | High |
| 1 | Green | #00FF00 | Low |
Associate colors with enumeration values:
Enumeration: AlarmLevel
Value: 0, Text: "Normal", ActiveColor: Green
Value: 1, Text: "Warning", ActiveColor: Yellow
Value: 2, Text: "Critical", ActiveColor: RedDisplay automatically uses colors when configured.
xml
<TextBox Text="{Tag.Motor1.ValueAsString}" />xml
<ComboBox SelectedValue="{Tag.Motor1.Value}">
<ComboBoxItem Value="0">Manual</ComboBoxItem>
<ComboBoxItem Value="1">Auto</ComboBoxItem>
</ComboBox>xml
<Rectangle Fill="{Tag.Status.ActiveColor}" />Text not displaying:
Wrong text shown:
Colors not working:
The enumeration set of a tag is part of its configuration. Scripts can read the Enumeration property of a tag but cannot assign it. Select the enumeration set in Designer instead:
To show different text for the same value depending on a runtime condition, build the text in a script, as in the example below.
csharp
// Override enumeration display
string GetStatusText(int value)
{
switch (value)
{
case 0: return "System Off";
case 1: return "System Running";
case 2: return "System in Fault";
default: return "Unknown";
}
}