Overview
Enumerations allow you to associate UNS Enumerations (Reference) ssociate numeric tag values with descriptive text strings, enhancing enabling meaningful data presentation by displaying text instead of numbers in displays. Tags linked to an Enumeration Set can display either the numeric value or its descriptive text equivalentHMI displays.
Enumerations provide:
- Navigate to Unified Namespace → Enumerations.
- On the toolbar of DataGrid, click on the "Insert New" button to create a new enumeration.
- Insert a descriptive name for your new enumeration in the name field.
- Finally, define the enumeration values along with their respective display texts.
- 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:
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude Steps style none
Creating Enumerations
- Navigate to Unified Namespace → Enumerations
- Click Insert New button on toolbar
- Enter enumeration name
- Define value mappings:
- Value: Numeric value
- Display Text: Associated text
- ActiveColor: Optional color
- InactiveColor: Optional color
Configuration Properties
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 |
Using Enumerations
Assign to Tag
- Go to Unified Namespace → Tags
- Show Enumeration column (right-click headers)
- Select enumeration for tag
- 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
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 |
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
Value | Text | Description |
---|---|---|
0 | Normal | Standard operation |
1 | Intermediary | Transition state |
2 | Transferred | Alternate position |
Priority Levels
EnumTicketColor
Value | Text | Color | Priority |
---|---|---|---|
0 | Red | #FF0000 | High |
1 | Green | #00FF00 | Low |
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
- Use standard names - Consistent naming convention
- Start with 0 - Follow programming standards
- Document values - Clear descriptions
- Plan for expansion - Leave gaps for future values
- Group related sets - Use categories
- Consider localization - Plan for multiple languages
- 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...
Page Tree | ||||
---|---|---|---|---|
|
Using Enumerations
After having the enumeration setup complete, you can use it to show strings associated with the value of a given tag.
To configure a Tag to use the specified Enumeration, navigate to UnifiedNamespace / Tags. Right-click on the column titles to open the 'Show Columns' combobox, then select the Enumeration column to make it visible. Next, click on the Enumeration cell in the desired tag line and choose the configured enumeration.
Once this is set up, use Tag.TagName.ValueAsString
in the display to show the string that corresponds to the configured value in the selected enumeration.
Enumerations Examples on Electrical Systems
EnumPower
0
Unpowered
Unpowered: The system or device is not receiving power.
1
Powered
Powered: The system or device is receiving power.
EnumCmd
0
Enable
Enable: Enables the system.
1
Disable
Disable: Disables the system.
EnumOpenedClosed
0
Opened
Opened: Circuit is open.
1
Closed
Closed: Circuit is closed.
EnumOpenClose
0
Open
Open: Command to open the circuit.
1
Close
Close: Command to close the circuit.
EnumManualAuto
0
Manual
Manual: System is in manual mode.
1
Auto
Auto: System is in automatic mode.
EnumActivateDeactivate
0
Activate
Activate: Activate the system or feature.
1
Deactivate
Deactivate: Deactivate the system or feature.
EnumOnepoleThreepole
0
One-pole
One-pole: Single-phase connection.
1
Three-pole
Three-pole: Three-phase connection.
EnumNormIntermTransf
0
Normal
Normal: Operating in standard conditions.
1
Intermediary
Intermediary: Operating in an intermediary state.
2
Transferred
Transferred: The component has been transferred to a different state.
EnumLocalRemote
0
Local
Local: Controlled locally.
1
Remote
Remote: Controlled remotely.
EnumIntermOpenClosedInconsist
0
Open
Open: Circuit is open and inconsistent.
1
Closed
Closed: Circuit is closed but inconsistent.
EnumUnblockedBlocked
0
Unblocked
Unblocked: System is unblocked.
1
Blocked
Blocked: System is blocked.
EnumUpDown
0
Up
Up: Direction is up.
1
Down
Down: Direction is down.
EnumParallelIndividual
0
Parallel
Parallel: Running in parallel.
1
Individual
Individual: Running individually.
EnumStopStart
0
Stop
Stop: Stop the system.
1
Start
Start: Start the system.
EnumOnOff
0
Off
Off: System is turned off.
1
On
On: System is turned on.
EnumNormalActed
0
Normal
Normal: System is operating normally.
1
Acted
Acted: System has acted on a command or event.
EnumBlockedUnblocked
0
Blocked
Blocked: System is blocked.
1
Unblocked
Unblocked: System is unblocked.
EnumRemoteLocal
0
Remote
Remote: Controlled remotely.
1
Local
Local: Controlled locally.
EnumActivatedDeactivated
0
Activated
Activated: System or feature is activated.
1
Deactivated
Deactivated: System or feature is deactivated.
EnumTicketColor
0
Red
Red: High priority.
1
Green
Green: Low priority.
EnumVisible
0
Visible
Visible: Can be seen.
1
Invisible
Invisible: Cannot be seen.
EnumTypeConnector
0
Delta
Delta: A three-phase connection in a closed loop.
1
Wye
Wye: Each phase connected to a central neutral point.
2
WyeGrounded
WyeGrounded: Wye connection with grounded neutral.
EnumReclosing
0
Single
Single: Single reclosing operation.
1
Auto
Auto: Automatic reclosing operation.
EnumTurnedOnTurnedOff
0
Turned On
Turned On: Device is turned on.
1
Turned Off
Turned Off: Device is turned off.
Enumerations Table
Name | Description |
ID | Identifies the unique identifier. |
VersionID | Shows the specific version number. |
Name | Names the Enumeration for identification and reference. |
Value | Sets the specific value associated with the Enumeration. |
Match | Defines the condition or criteria that match the enumeration value. |
ActiveColor | Specifies the color to display when the Enumeration is active. |
InactiveColor | Specifies the color to display when the Enumeration is inactive. |
Category | Classifies the Enumeration within a specific group or category. |
LockState | Indicates whether the Enumeration is locked and cannot be modified. |
LockOwner | Identifies the owner responsible for locking the Enumeration. |
DateCreated | Records the date and time when the Enumeration was created. |
DateModified | Records the date and time when the Enumeration was last modified. |
Description | Summarizes the purpose and details of the Enumeration. |
Display Text | Specifies the text to be displayed for the Enumeration in the interface. |
In this section:
Page Tree | ||||
---|---|---|---|---|
|