Attention

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

P4013

Code

P4013

Message

POU declaration name is duplicated

This error occurs when a POU (Program Organization Unit) declaration name is duplicated within the same scope.

Example

The following code will generate error P4013:

FUNCTION_BLOCK MyFunction
END_FUNCTION_BLOCK

FUNCTION_BLOCK MyFunction  (* Error: Duplicate POU name *)
END_FUNCTION_BLOCK

The function block MyFunction is declared twice, which is not allowed.

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

FUNCTION_BLOCK MyFunction1
END_FUNCTION_BLOCK

FUNCTION_BLOCK MyFunction2  (* Correct: Different name *)
END_FUNCTION_BLOCK