Attention

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

P0037

Code

P0037

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

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