About Enumerations

An enumeration allows you to define a set of values that a variable can be assigned to. This feature is useful for restricting the possible values that a variable can take.

In addition, you can use enumerations to define human-readable options for variables of Integer (Data Variable Type) or String (Data Variable Type) that are used to store a selected value from a group of possible options.

1. Via the Data Tab

1.1 Create a Variable of Type Number or String

If you haven't already done so, create a variable of Integer (Data Variable Type) or String (Data Variable Type).

1.2 Add Possible Values in Data Tab

Example of an enumeration for an integer variable that represents machine state.

Example of an enumeration for an integer variable that represents machine state.


2. Via the Content Tab: Using Quick Edit

2.1 Find Your Data Variable and Open Quick Edit

  1. Find the Data Variable property inside the Properties Panel (Content View) that is linked to the Data Variable (Dynamic Property Type) you would like to modify.

  2. Press the Quick Edit Button to open the Quick Edit Dialog

screenshot-2023-02-17.Google Chrome.000612@2x.png

  1. Edit the meta data of the variable. Use the Confirm to apply the changes to the preview.

    <aside> <img src="/icons/hand_gray.svg" alt="/icons/hand_gray.svg" width="40px" /> Note: These changes won’t be persisted to your project until you hit the Save button.

    </aside>

screenshot-2023-02-17.Google Chrome.000620@2x.png

2.2 Activate the Enumeration Feature and Add Possible Values.

  1. Find the Group Enumeration in the Properties Panel (Content View) and activate it for this variable.
  2. Add possible values for this variable and provide a label for each state. These labels will be used in the HMI, for example if you want to display a dropdown for setting the machine's state.