R_TRIG (Rising Edge Detection)
Detects a rising edge (FALSE-to-TRUE transition) on a monitored input and produces a single-cycle pulse on the action's output variable.
Description
The R_TRIG instruction watches the boolean variable passed as its operand for a rising edge (the moment that signal transitions from FALSE to TRUE). When the edge occurs, the action's name (the output variable) is set to TRUE for exactly one scan cycle, then returns to FALSE.
Two distinct variables are involved:
name: the output variable. PulsesTRUEfor one cycle on each rising edge.operands[0]: the input signal monitored for the rising edge.
This is useful when you need to trigger an action only once at the moment a condition becomes true, rather than continuously while it is true.
Typical uses include:
- Counting events (one increment per activation)
- Triggering a one-shot operation
- Detecting button presses (rather than button held states)
R_TRIGrequires the input operand. Without it, the instruction has nothing to compare against and the output never pulses. The Sequence visual editor and the runtime both warn when the operand is missing.
R_TRIGis often confused with theActionQualifier.P(pulse on step activation) qualifier, but they serve different purposes.R_TRIGis an instruction-level edge detector on a signal, whileActionQualifier.Pis a qualifier-level pulse on step activation.
Syntax
- name: the output variable name (pulsed for one cycle on each rising edge)
- description: human-readable description of the action
- qualifier:
ActionQualifierenum (default:ActionQualifier.N) - instruction:
ActionInstruction.R_TRIG - operands:
[ActionOperand("input_signal")](the boolean variable to monitor)
Syntax
Sequence Visual Editor

The operand chip is the watched CLK input.
Python
from automation_machine import Sequence, StepType, ActionInstruction, ActionOperand
class Example(Sequence):
def setup(self):
step = self.add_step(StepType.INITIAL, name="StepName")
step.add_action(
"edge_var",
"Rising edge of input_signal",
instruction=ActionInstruction.R_TRIG,
operands=[ActionOperand("input_signal")],
)
See Also
- F_TRIG (Falling Edge Detection): detects FALSE transitions
- SR (Set-Reset Flip-Flop): latch an edge result
- Action Qualifiers Overview
- Instructions Overview