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:\ \ \ \
Example in FBD:\ \ \ \
Example in ST:\ \ \ \
RTRIGInst(CLK:= VarBOOL1);
VarBOOL2 := RTRIGInst.Q;