246 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 5 Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ)
Limit (LIM)
The LIM instruction tests whether the Test value is within the range of the Low
Limit to the High Limit.
Operands:
Relay Ladder
Structured Text
Structured text does not have a LIM instruction, but you can achieve the same
results by using structured text.
IF (LowLimit <= HighLimit AND
(Test >= LowLimit AND Test <= HighLimit)) OR
(LowLimit >= HighLimit AND
(Test <= LowLimit OR Test >= HighLimit)) THEN
<statement>;
END_IF;
Operand Type Format Description
Low limit SINT
INT
DINT
REAL
Immediate Tag Value of lower limit
A SINT or INT tag converts to a DINT value by sign-extension.
Test SINT
INT
DINT
REAL
Immediate Tag Value to test
A SINT or INT tag converts to a DINT value by sign-extension.
High limit SINT
INT
DINT
REAL
Immediate Tag Value of upper limit
A SINT or INT tag converts to a DINT value by sign-extension.