Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

Defining

Enumerations provide:

  1. Navigate to Unified Namespace → Enumerations.
  2. On the toolbar of DataGrid, click on the "Insert New" button to create a new enumeration. Image Removed
  3. Insert a descriptive name for your new enumeration in the name field.
  4. 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
maxLevel2
minLevel2
indent10px
excludeSteps
stylenone

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...

Page Tree
root@parent
spaces93DRAF

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

NameValuesDisplay TextDescription

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
rootV10:@parent
spacesV10