LIM In range (LIM): MN ≤ IN ≤ MX

Also called: limit test, range check, between two values, window comparison

Passes power when MN ≤ IN ≤ MX.

What it does

The LIM comparison checks that a value is within a range, limits included.

When to use it

For a tolerance window: correct weight, temperature within the working range.

Operands

European mnemonicAmerican mnemonicNameData typeDirectionRequiredMeaning
MNMNLow limitINT, DINT, REAL, TIME / DINTInputYesLow limit (included).
ININTested valueINT, DINT, REAL, TIME / DINTInputYesValue tested.
MXMXHigh limitINT, DINT, REAL, TIME / DINTInputYesHigh limit (included).
MnemonicNameData typeDirectionRequiredMeaning
MNLow limitINT, DINT, REAL, TIMEInputYesLow limit (included).
INTested valueINT, DINT, REAL, TIMEInputYesValue tested.
MXHigh limitINT, DINT, REAL, TIMEInputYesHigh limit (included).
MnemonicNameData typeDirectionRequiredMeaning
MNLow limitINT, DINT, REALInputYesLow limit (included).
INTested valueINT, DINT, REALInputYesValue tested.
MXHigh limitINT, DINT, REALInputYesHigh limit (included).

Timing diagram

V151015251510H10123456789101112scans

Timing diagram checked against the simulator (the same engine as the editor).

Example

European style
American style

H1 turns on when V1 is between 10 and 20.

Try it in the simulatorThe example opens in the free simulator; your own program stays as it was.

Behaviour in detail

European (IEC) and American styles

European: often written as two comparisons (GE and LE); LIMIT, for its part, clamps a value instead of testing it.

American: LIM (Low Lim, Test, High Lim); on an American PLC a low limit greater than the high one tests outside the range, which is not the case here.

See also