Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
P4016¶
- Code
P4016
- Message
Function declaration name is duplicated
This error occurs when a function declaration name is duplicated within the same scope.
Example¶
The following code will generate error P4016:
FUNCTION MyFunction : INT
END_FUNCTION
FUNCTION MyFunction : INT (* Error: Duplicate function name *)
END_FUNCTION
The function MyFunction is declared twice, which is not allowed.
To fix this error, ensure all function names are unique within their scope:
FUNCTION MyFunction1 : INT
END_FUNCTION
FUNCTION MyFunction2 : INT (* Correct: Different name *)
END_FUNCTION