AutomationView Documentation

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:

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:

R_TRIG requires 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_TRIG is often confused with the ActionQualifier.P (pulse on step activation) qualifier, but they serve different purposes. R_TRIG is an instruction-level edge detector on a signal, while ActionQualifier.P is a qualifier-level pulse on step activation.


Syntax

Syntax

Sequence Visual Editor

Action start_edge with the R_TRIG instruction watching start_pb
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