iec-checker
iec-checker copied to clipboard
PLCOpen N1: Avoid physical addresses
The use of hardcoded physical addresses should be avoided.
So, we have to report any physical address in the code, except those that are used when initializing variables:
PROGRAM l10
VAR
a AT %MW10.2.4.1 : INT;
END_VAR
%MW10.2.4.1 := 42; (* PLCOPEN-N1 *)
a := 42; (* ok *)
END_PROGRAM
This could be implemented as a simple pass on AST.