6.1.3.6.1 INRANGE
Function
When the ON input is 1 and IN is not less than MN and not greater than MX, the OUT output is 1; otherwise, the output is 0
LD Graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| ON | Var_Input | BOOL | Function input |
| IN | Var_Input | ANY_ELEMENTARY | The value to be compared |
| MX | Var_Input | ANY_ELEMENTARY | Upper range |
| MN | Var_Input | ANY_ELEMENTARY | Range lower limit |
| Return value | Function value | BOOL | Function output |
warning
- ANY_ELEMENTARY contains all basic data types (bit strings, integers, floating point numbers, characters and strings, times and dates)
- ST language relational expression:
OUT := ON & (MX>=IN) & (IN>=MN);
Example
- LD sample animation is as follows:

- ST sample animation is as follows:
