MAX (maximum)

Calculates the maximum of two integer values.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
MAX
MAX
MAX parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
When set to true, the instruction is enabled.
  • TRUE: Execute the current computation.
  • FALSE: There is no computation.
Applies to ladder diagram programs.
IN1
Input
DINT
Any signed integer value.
IN2
Input
DINT
Cannot be Real.
MAX
Output
DINT
Maximum of both input values.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

MAX examples

MAX function block diagram example
MAX function block diagram example
MAX ladder diagram example
MAX ladder diagram example
MAX structured text example
MAX structured text example
(* ST Equivalence: *) new_value := MAX (MIN (max_value, value), min_value); (* bounds the value to the [min_value..max_value] set *)
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal