7.7.2 MAX
Function
Take the maximum value function and assign the maximum value in IN1...INn to OUT
LD graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN1 | Var_Input | ANY_ELEMENTARY | Comparison number 1 |
| IN2 | Var_Input | ANY_ELEMENTARY | Comparison number 2 |
| Function name | Return value | ANY_ELEMENTARY | Output maximum value |
warning
- The parameter types of parameters IN1, IN2 and OUT must be the same, otherwise the function cannot be executed
- MAX is an extensible function, and inputs can be added by clicking the "+" in the graph
- ANY_ELEMENTARY includes all basic types (bit strings, integers, floating point numbers, characters and strings, times and dates)
Example
- LD sample animation is as follows:

- ST example is shown in the following code:
OUT:=MAX(IN1:=10,IN2:=100);
OUT2:=MAX(IN1:=10,IN2:=100,IN3:=1000,IN4:=10000,IN5:=50000);