iec-checker
iec-checker copied to clipboard
False positive: PLCOpen CP1
The following snippet raises false positive for CP1:
PROGRAM l10
VAR
END_VAR
%MW10.2.4.1 := 42; (* False positive PLCOPEN-CP1 *)
END_PROGRAM
Actually, this warning should be reported only when accessing a direct located struct member, as it is specified in the example from the PLCOpen document:
STRUCT EXAMPLE_STRUCT
X : DINT
Y : BOOL;
Z : STRING[40];
END_STRUCT;
VAR
instance : EXAMPLE_STRUCT AT %MW500;
END_VAR
// Write the first character of Z:
%MW504 := 'E';