LIMIT
Restricts integer values to a given interval. Integer values between the minimum and maximum are unchanged. Integer values greater than the maximum are replaced with the maximum value. Integer values less than the minimum are replaced with the minimum value.

Arguments | |||
---|---|---|---|
MIN | MIN | DINT | Minimum value allowed |
IN | IN | DINT | Any signed integer value |
MAX | MAX | DINT | Maximum value allowed |
LIMIT | Q | DINT | Input value restricted to the allowed range |
Example
(* FBD Program using "LIMIT" Function *)

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