Semantic Error (SEM1077): Ambiguous enumeration value '...'.
In a code worksheet, an enumeration element is accessed, whose membership cannot be determined definitely, i.e., the element may belong to one of several user-defined enumerations.
If enumerations contain elements with the same name, such elements must always be used together with the relating enumeration name.
Background: accessing enumeration elements in the code
According to the IEC 61131 standard, an enumeration value can be accessed as follows:- Either with the preceding enumeration name and a following # character.
MyInt := ColorEnum#Red; - or by only specifying the element name itself.
MyInt := Red;The second notation may, however, only be used if the element is nevertheless uniquely identified without enumeration name.
- If another enumeration also contains an element named Red, the second notation is no longer allowed.
- If a variable of the same name exists, the statement MyInt := Red; always accesses the variable but not the enumeration element.
In both cases, the enumeration name must be specified before the element name.