[CMP_RNG] Compare range multistate

Function block CMP_RNG calculates whether an input value is within, outside, or below a range and supplies the result to the appropriate outputs.

CMP_RNG calculates whether an input value is within, outside, or below a range and supplies the result to the appropriate outputs.

Functioning

CMP_RNG compares the input value to the min. and max. values of the range, and, depending on the results, sets the outputs [MinMaxRng], [LtRngMin] and [GtRngMax]to 0 or 1.

 

Result

Condition

MinMaxRng

LtRngMin

GtRngMax

In < RngMin

0

1

0

RngMin <= In <= RngMax

1

0

0

In > RngMax

0

0

1

Pins

Input

Description

Data type

Default value
Value range

In

Input

The enumeration must be configured. Else, only values are displayed. 'Auto' must appear at the very beginning.

Integer

1

RngMin

Range minimum

Integer

1

1…32767

RngMax

Range maximum

Integer

32767

1…32767

 

Output

Description

Data type

Default value
Value range

MinMaxRng

Minimum/maximum range

Boolean

0

0 - The value of In is located outside the range.
1 - The value of In is within the range.

LtRngMin

In less than minimal range

Boolean

0

0 - The value of In is above the minimum range.
1 - The value of In is below the minimum range.

GtRngMax

In greater than maximal range

Boolean

0

0 - The value of In is below the maximum range.
1 - The value of In is above the maximum range.