iec-checker icon indicating copy to clipboard operation
iec-checker copied to clipboard

PLCOpen N1: Avoid physical addresses

Open jubnzv opened this issue 2 years ago • 0 comments

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.

jubnzv avatar Oct 26 '22 00:10 jubnzv