Attention
IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.
R_TRIG¶
Rising edge detector. Output Q is TRUE for one scan cycle when the
input CLK transitions from FALSE to TRUE.
IEC 61131-3 |
Section 2.5.2.3.2 |
Support |
Not yet supported |
Inputs¶
Name |
Type |
Description |
|---|---|---|
|
|
Signal to monitor for rising edge |
Outputs¶
Name |
Type |
Description |
|---|---|---|
|
|
Edge output (TRUE for one scan on rising edge) |
Behavior¶
The function block stores the previous value of CLK. When CLK
transitions from FALSE to TRUE, the output Q is set to TRUE
for one scan cycle. On all subsequent scans where CLK remains TRUE,
Q is FALSE. When CLK is FALSE, Q is always FALSE.
Example¶
VAR
edge1 : R_TRIG;
button : BOOL;
pressed : BOOL;
END_VAR
edge1(CLK := button);
pressed := edge1.Q;
See Also¶
F_TRIG — falling edge detector