Attention

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

P2011

Code

P2011

Message

Parent type is not declared

This error occurs when a type alias references a parent type that has not been declared.

Example

The following code will generate error P2011:

TYPE
    MyAlias : UndeclaredParentType;  (* Error: UndeclaredParentType is not declared *)
END_TYPE

The type alias MyAlias references UndeclaredParentType which has not been declared.

To fix this error, declare the parent type before creating the alias:

TYPE
    BaseType : INT;
    MyAlias : BaseType;  (* Correct: BaseType is now declared *)
END_TYPE