SA0056: Constant out of valid rangePermalink

Detects literals (constants) outside of the valid range of the operator

Justification: The message is issued in cases when a value is compared with a constant that is outside of the range of this value. Then the comparison constantly returns ‎TRUE‎ or ‎FALSE‎. This is an indication of a programming error.

Importance: High

Example

PROGRAM PLC_PRG
VAR
	byTestVar: BYTE; 
END_VAR

WHILE byTestVar >= 260 DO
 byTestVar := byTestVar + 1;
END_WHILE

--> SA0056: Constant out of valid range