LIMIT

Limits an integer value into a given interval. Whether it keeps its value if it is between minimum and maximum, or it is changed to maximum if it is above, or it is changed to minimum if it is below.
lrsf_li1.gif
Arguments
MIN
MIN
DINT
Minimum allowed value
IN
IN
DINT
Any signed integer value
MAX
MAX
DINT
Maximum allowed value
LIMIT
Q
DINT
Input value bounded to allowed range
Example
(* FBD Program using "LIMIT" Function *)
lrsf_li2
(* ST Equivalence: *)
new_value := LIMIT (min_value, value, max_value); (* bounds the value to the [min_value..max_value] set *)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal