Attention
These docs are a bit ambitious. The steps described are accurate but IronPLC cannot yet run programs.
P0036¶
- Code
P0036
- 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 P0036:
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