Function Block - Rising pulse detection
CLK : BOOL Boolean signal
Q : BOOL TRUE when the input changes from FALSE to TRUE
CLK |
CLK prev |
Q |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
Although ]P[ an ]N[ contacts may be used in LD language, it is recommended to use declared instances of R_TRIG or F_TRIG function blocks in order to avoid unexpected behaviour during an On Line change.
(* MyTrigger is declared as an instance of
R_TRIG function block *)
MyTrigger (CLK);
Q := MyTrigger.Q;
(* the input signal is the
rung - the rung is the output *)
(* MyTrigger is declared as an instance of
R_TRIG function block *)
Op1: CAL MyTrigger (CLK)
LD MyTrigger.Q
ST Q