An Enumerated Type is a user-defined type with a finite number of values.You cannot directly define a data item as an enumerated type. First, define the data item as a user-defined type, and then define the user-defined type as an enumerated type. You define the values for the enumeration in the “Definition” field of the Properties by listing the values in brackets separated by commas. For example,
Enumerated values and other textual items cannot have the same name within the same scope. For example, data-item
SUN
cannot be declared in the same chart where an enumerated valueSUN
is declared.Note: Enumerated range and indices of arrays are not supported in C. The C code generator shall approximate this capability in the generated code.There are two constant operators and five general operators for enumerated types. These are summarized in the Constant Operators Table and the General Operators Table.
* Parameters to these constant operators are user-defined types that were defined as enumerated types.
* Parameters to these operators are either enumerated values (literals) or variables. The T’VAL notation is used for non-unique literals.