[LIM_DI] Limiter for DINT values

Description

This instruction compares the input values IN, MAX and MIN. It checks whether IN is within or outside the interval limited by MIN and MAX.

If the low limit MIN of the interval is greater than the high limit MAX, the output value OUT = MAX and the output parameters OUTU and OUTL are set to 1.

IN ≥ MAX represents a violation of the high limit, OUT = MAX, OUTU = 1 and OUTL = 0. IN ≤ MIN represents a violation of the low limit, OUT = MIN, OUTU = 0, OUTL = 1. If IN is between MIN and MAX, OUT = IN, OUTU = 0, OUTL = 0 are set.

Troubleshooting

ENO = 0 with MIN > MAX --> OUT = MAX; OUTU = OUTL = 1

Parameters

Parameters

Declaration

Data type

Description

Default

MAX

Input

DINT

High limit

0

IN

Input

DINT

Input value

0

MIN

Input

DINT

Low limit

0

OUTU

Output

BOOL

High limit violated

0

OUTL

Output

BOOL

Low limit violated

0

OUT

Output

DINT

Output value

0