Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
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