UNS Enumerations (Reference) ssociate
Enumerations allow you to associate numeric tag values with descriptive text strings, enhancing enabling meaningful data presentation by displaying text instead of numbers in HMI displays. Tags linked to an Enumeration Set can display either the numeric value or its descriptive text equivalent.On this page:
Enumerations provide:
Enumerations transform raw numeric values into human-readable states like "Running/Stopped" or "Open/Closed".
Table of Contents maxLevel
2 minLevel 2
indent
10px
exclude
Steps
style
none
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.
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 |
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"
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: Red
Display 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:
csharp
// Change enumeration at runtime
if (@Tag.SystemType == 1)
@Tag.Status.Enumeration = "EnumMotorStates";
else
@Tag.Status.Enumeration = "EnumValveStates";
csharp
// Override enumeration display
string GetStatusText(int value)
{
return value switch
{
0 => "System Off",
1 => "System Running",
2 => "System in Fault",
_ => "Unknown"
};
}
Page Tree | ||
---|---|---|
|
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.
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: