Attention

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

P0019

Code

P0019

Message

Type declaration name is duplicated

This error occurs when a type declaration name is duplicated within the same scope.

Example

The following code will generate error P0019:

TYPE
    the_struct : STRUCT
        member: BOOL;
    END_STRUCT;
    the_struct : STRUCT  (* Error: Duplicate type name *)
        member: BOOL;
    END_STRUCT;
END_TYPE

The type the_struct is declared twice within the same TYPE block, which is not allowed.

To fix this error, ensure all type names are unique within their scope:

TYPE
    the_struct : STRUCT
        member: BOOL;
    END_STRUCT;
    another_struct : STRUCT  (* Correct: Different name *)
        member: BOOL;
    END_STRUCT;
END_TYPE