Attention

These docs are a bit ambitious. The steps described are accurate but IronPLC cannot yet run programs.

P0005

Code

P0005

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 P0005:

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