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
LIMIT
LIMIT parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Function enable.
  • TRUE: Execute current LIMIT computation.
  • FALSE: There is no computation.
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 ladder diagram example
LIMIT structured text 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
Limit - Results
Limit - Results
Limit - Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal