Attention

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

P2013

Code

P2013

Message

Array element type is not declared

This error occurs when an array declaration references an element type that has not been declared.

Example

The following code will generate error P2013:

TYPE
    DataArray : ARRAY[1..10] OF UndeclaredElementType;  (* Error: Element type not declared *)
END_TYPE

The array DataArray references UndeclaredElementType as its element type, but this type has not been declared.

To fix this error, declare the element type first:

TYPE
    ElementType : INT;
    DataArray : ARRAY[1..10] OF ElementType;  (* Correct: Element type declared *)
END_TYPE

Alternatively, use a built-in type:

TYPE
    DataArray : ARRAY[1..10] OF INT;  (* Correct: INT is a built-in type *)
END_TYPE