Attention

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

P4014

Code

P4014

Message

Symbol declaration name is duplicated

This error occurs when a symbol (variable, constant, or other identifier) is declared more than once in the same scope.

Example

The following code will generate error P4014:

FUNCTION_BLOCK Example
VAR
    DuplicateName : INT;
    DuplicateName : BOOL;  (* Error: Symbol name duplicated *)
END_VAR
END_FUNCTION_BLOCK

The symbol DuplicateName is declared twice in the same variable section, which is not allowed.

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

FUNCTION_BLOCK Example
VAR
    FirstVariable : INT;
    SecondVariable : BOOL;  (* Correct: Different name *)
END_VAR
END_FUNCTION_BLOCK