Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

P2003

Code

P2003

Message

Enumeration type declaration has duplicated value

This error occurs when an enumeration type declaration has duplicate values.

Example

The following code will generate error P2003:

TYPE
    LogLevel : (CRITICAL, CRITICAL) := CRITICAL;  (* Error: Duplicate value *)
END_TYPE

The enumeration has two values with the same name CRITICAL, which is not allowed.

To fix this error, ensure all enumeration values are unique:

TYPE
    LogLevel : (CRITICAL, WARNING, INFO, DEBUG) := INFO;  (* All values unique *)
END_TYPE