SA0056: Constant out of valid range
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 which 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 66. Example
PROGRAM PLC_PRG VAR byTestVar: BYTE; END_VAR
WHILE byTestVar >= 260 DO byTestVar := byTestVar + 1; END_WHILE
Output in the Messages view:
SA0056: Constant out of valid range