R_TRIGΒΆ

Provided by Standard Library.

Function block detecting a rising edge.

Inputs:

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

Outputs:

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

The output Q and an internal boolean help variable M will remain FALSE as long as the input variable CLK is FALSE. As soon as CLK returns TRUE, 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 rising edge in CLK.

(Q := CLK AND NOT M;

M := CLK;)

Declaration example:\ \ \ \

RTRIGInst : R_TRIG ;

Example in IL:\ \ \ \

../_images/ef59d2e61e8f833cc0a8640e01947982

Example in FBD:\ \ \ \

../_images/e3c147e61e8f8313c0a8640e01947982

Example in ST:\ \ \ \

RTRIGInst(CLK:= VarBOOL1);

VarBOOL2 := RTRIGInst.Q;