UNS Enumerations (Reference) ssociate numeric tag values with descriptive text strings, enabling meaningful data presentation by displaying text instead of numbers in HMI displays.

Enumerations provide:

  • Value-to-text mapping
  • Descriptive state display
  • Color associations
  • Multilingual support
  • Reusable definitions
  • Consistent terminology

Enumerations transform raw numeric values into human-readable states like "Running/Stopped" or "Open/Closed".

In this page:

Creating Enumerations

  1. Navigate to Unified Namespace → Enumerations
  2. Click Insert New button on toolbar
  3. Enter enumeration name
  4. Define value mappings:
    • Value: Numeric value
    • Display Text: Associated text
    • ActiveColor: Optional color
    • InactiveColor: Optional color

Configuration Properties

PropertyDescriptionRequired
NameEnumeration set identifierYes
ValueNumeric value to mapYes
Display TextText to show for valueYes
MatchMatching criteria/conditionNo
ActiveColorColor when value matchesNo
InactiveColorColor when value doesn't matchNo
CategoryClassification groupNo
DescriptionDocumentation textNo

Using Enumerations

Assign to Tag

  1. Go to Unified Namespace → Tags
  2. Show Enumeration column (right-click headers)
  3. Select enumeration for tag
  4. Tag now displays text instead of number

Access in Runtime

csharp

// Get numeric value
int value = @Tag.Motor1.Value;  // Returns: 1

// Get enumeration text
string text = @Tag.Motor1.ValueAsString;  // Returns: "Running"

// Display value (automatic)
string display = @Tag.Motor1.DisplayValue;  // Returns: "Running"

Common Enumeration Sets

Basic States

OnOff

ValueTextUse Case
0OffEquipment stopped
1OnEquipment running

OpenClosed

ValueTextUse Case
0OpenValve/breaker open
1ClosedValve/breaker closed

ManualAuto

ValueTextUse Case
0ManualLocal control
1AutoAutomatic control

Electrical System Examples

Circuit States

EnumOpenedClosed

  • 0 → "Opened" (Circuit open)
  • 1 → "Closed" (Circuit closed)

Control Modes

EnumLocalRemote

  • 0 → "Local" (Local control)
  • 1 → "Remote" (Remote control)

Power States

EnumPower

  • 0 → "Unpowered" (No power)
  • 1 → "Powered" (Power present)

Connection Types

EnumTypeConnector

  • 0 → "Delta" (Delta connection)
  • 1 → "Wye" (Wye connection)
  • 2 → "WyeGrounded" (Grounded wye)

Multi-State Enumerations

Transfer Switch

EnumNormIntermTransf

ValueTextDescription
0NormalStandard operation
1IntermediaryTransition state
2TransferredAlternate position

Priority Levels

EnumTicketColor

ValueTextColorPriority
0Red#FF0000High
1Green#00FF00Low

Color Configuration

Associate colors with enumeration values:

Enumeration: AlarmLevel
Value: 0, Text: "Normal", ActiveColor: Green
Value: 1, Text: "Warning", ActiveColor: Yellow
Value: 2, Text: "Critical", ActiveColor: Red

Display automatically uses colors when configured.


Best Practices

  1. Use standard names - Consistent naming convention
  2. Start with 0 - Follow programming standards
  3. Document values - Clear descriptions
  4. Plan for expansion - Leave gaps for future values
  5. Group related sets - Use categories
  6. Consider localization - Plan for multiple languages
  7. Test all values - Verify mappings work

Display Integration

TextBox Display

xml

<TextBox Text="{Tag.Motor1.ValueAsString}" />

ComboBox Selection

xml

<ComboBox SelectedValue="{Tag.Motor1.Value}">
    <ComboBoxItem Value="0">Manual</ComboBoxItem>
    <ComboBoxItem Value="1">Auto</ComboBoxItem>
</ComboBox>

Color Indication

xml

<Rectangle Fill="{Tag.Status.ActiveColor}" />

Troubleshooting

Text not displaying:

  • Verify enumeration assigned to tag
  • Check value exists in enumeration
  • Use ValueAsString property
  • Confirm display binding

Wrong text shown:

  • Review value mappings
  • Check for duplicate values
  • Verify enumeration selection
  • Test with known values

Colors not working:

  • Configure ActiveColor/InactiveColor
  • Use color properties in display
  • Check color format (#RRGGBB)
  • Test color visibility

Advanced Usage

Dynamic Enumeration Selection

csharp

// Change enumeration at runtime
if (@Tag.SystemType == 1)
    @Tag.Status.Enumeration = "EnumMotorStates";
else
    @Tag.Status.Enumeration = "EnumValveStates";

Custom Value Formatting

csharp

// Override enumeration display
string GetStatusText(int value)
{
    return value switch
    {
        0 => "System Off",
        1 => "System Running",
        2 => "System in Fault",
        _ => "Unknown"
    };
}



In this section...