Function Block - Detects High and Low limits of a signal with hysteresis.
H : REAL
Value of the High
limit
X :
REAL Input
signal
L : REAL
Value of the Low limit
EPS : REAL
Value of the hysteresis
QH : BOOL
TRUE if the signal exceeds the High
limit
Q : BOOL
TRUE if the signal
exceeds one of the limits (equals to QH OR
QL)
QL :
BOOL TRUE if the
signal exceeds the Low limit
In LD language, the input rung (EN) is used for enabling the block. The output rung is the QH output.
(* MyAlarm is a declared instance of LIM_ALRM
function block *)
MyAlarm (H, X, L, EPS);
QH := MyAlarm.QH;
Q := MyAlarm.Q;
QL := MyAlarm.QL;
(* The block is not called if EN is FALSE
*)
(* MyAlarm is a declared instance of LIM_ALRM
function block *)
Op1: CAL MyAlarm (H, X,
L, EPS)
LD MyAlarm.QH
ST QH
LD MyAlarm.Q
ST Q
LD MyAlarm.QL
ST QL