LIMIT
PROGRAM LIMIT_DEMO VAR REAL1,REAL2: REAL; END_VAR REAL2:= LIMIT(IN:=REAL1, MN:= 0, MX:=10); //LZE VOLAT I JAKO REAL2:= LIMIT(REAL1, 0, 10) END_PROGRAM
Limits the output value in the ranges from MN (minimum) to MX (maximum). The function can be also described as MIN(MAX(IN,MN),MX).
Input | Type | Description |
IN | ANY_ELEMENTARY | Input value |
MN | ANY_ELEMENTARY | Minimum value |
MX | ANY_ELEMENTARY | Maximum value |
Output | Type | Description |
⇒ | ANY_ELEMENTARY | Output value |