F_TRIGΒΆ

Provided by Standard Library.

Function block detecting a falling edge.

Inputs:

CLK: BOOL; incoming boolean signal to be checked for rising edge

Outputs:

Q: BOOL; becomes TRUE if a falling edge occurs at CLK

The output Q and an internal boolean help variable M will remain FALSE as long as the input variable CLK returns TRUE. As soon as CLK returns FALSE, Q will first return TRUE, then M will be set to TRUE. This means each time the function is called up, Q first will be set TRUE, then return FALSE, followed by a falling edge in CLK.

(Q := CLK AND NOT M;

(Q := NOT CLK AND NOT M;

M := NOT CLK;)

Declaration example:\ \ \ \

FTRIGInst : F_TRIG ;

Example in IL:\ \ \ \

../_images/1d4022ae1e8f7b9ac0a8640e01947982

Example in FBD:\ \ \ \

../_images/5b7d1b7d1e8f7b70c0a8640e01947982

Example in ST:\ \ \ \

FTRIGInst(CLK:= VarBOOL1);

VarBOOL2 := FTRIGInst.Q;