Attention

IronPLC implements many parts of the IEC 61131-3 standard and is working toward full Structured Text support. Key features still missing include arrays and structures. Try it out in the IronPLC Playground.

P2009

Code

P2009

Message

Parent enumeration is not declared

This error occurs when an enumeration type extends from a parent enumeration that has not been declared.

Example

The following code will generate error P2009:

TYPE
    ChildEnum : (VALUE1, VALUE2) EXTENDS UndeclaredParentEnum;  (* Error: Parent enum not declared *)
END_TYPE

The enumeration ChildEnum tries to extend UndeclaredParentEnum which has not been declared.

To fix this error, declare the parent enumeration first:

TYPE
    BaseEnum : (BASE_VALUE1, BASE_VALUE2);
    ChildEnum : (VALUE1, VALUE2) EXTENDS BaseEnum;  (* Correct: Parent enum declared *)
END_TYPE