LIMIT (limit test)
The LIMIT instruction restricts integer values to a given interval. Integer values between the minimum and maximum are not changed. Integer values greater than the maximum are replaced with the maximum value. Integer values less than the minimum are replaced with the minimum value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
LIMIT

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | Function enable.
Applies to ladder diagram programs. |
MIN | Input | DINT | Minimum value supported. |
IN | Input | DINT | Any signed integer value. |
MAX | Input | DINT | Maximum value supported. |
LIMIT | Output | DINT | Input value bounded to the supported range. |
ENO | Output | BOOL | Enable output. Applies to ladder diagram programs. |
LIMIT examples
LIMIT function block diagram example

LIMIT ladder diagram example

LIMIT structured text example

(* ST Equivalence: *) new_value := LIMIT (min_value, value, max_value); (* bounds the value to the [min_value..max_value] set *)
Results



Provide Feedback