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 mnemonic | American mnemonic | Name | Data type | Direction | Required | Meaning |
|---|---|---|---|---|---|---|
| MN | MN | Low limit | INT, DINT, REAL, TIME / DINT | Input | Yes | Low limit (included). |
| IN | IN | Tested value | INT, DINT, REAL, TIME / DINT | Input | Yes | Value tested. |
| MX | MX | High limit | INT, DINT, REAL, TIME / DINT | Input | Yes | High limit (included). |
| Mnemonic | Name | Data type | Direction | Required | Meaning |
|---|---|---|---|---|---|
| MN | Low limit | INT, DINT, REAL, TIME | Input | Yes | Low limit (included). |
| IN | Tested value | INT, DINT, REAL, TIME | Input | Yes | Value tested. |
| MX | High limit | INT, DINT, REAL, TIME | Input | Yes | High limit (included). |
| Mnemonic | Name | Data type | Direction | Required | Meaning |
|---|---|---|---|---|---|
| MN | Low limit | INT, DINT, REAL | Input | Yes | Low limit (included). |
| IN | Tested value | INT, DINT, REAL | Input | Yes | Value tested. |
| MX | High limit | INT, DINT, REAL | Input | Yes | High limit (included). |
Timing diagram
Timing diagram checked against the simulator (the same engine as the editor).
Example
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
- Limits are included.
- If MN is greater than MX, the condition is never true (no inverted range here).
- Computed as (IN ≥ MN) AND (IN ≤ MX).
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.