Attention

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

P2010

Code

P2010

Message

Library has a recursive cycle in resolving type names

This error occurs when there is a recursive cycle in resolving type names, where types reference each other in a circular manner.

Example

The following code will generate error P2010:

TYPE
    TypeA : TypeB;
    TypeB : TypeA;  (* Error: Circular type reference *)
END_TYPE

The types TypeA and TypeB reference each other, creating a circular dependency that cannot be resolved.

To fix this error, break the cycle by using a base type:

TYPE
    BaseType : INT;
    TypeA : BaseType;
    TypeB : BaseType;  (* Correct: Both reference base type *)
END_TYPE