Detects a rising edge (FALSE-to-TRUE transition) and produces a single-cycle pulse.
The R_TRIG instruction monitors its input for a rising edge - the moment the signal transitions from FALSE to TRUE. When this transition occurs, the output produces a single-cycle pulse (TRUE for exactly one scan cycle), then returns to FALSE.
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_TRIGis often combined with theActionQualifier.P(pulse on activation) qualifier, but they serve different purposes.R_TRIGis an instruction-level edge detector on the variable, whileActionQualifier.Pis a qualifier-level pulse on the step activation.
ActionQualifier enum (default: ActionQualifier.N)ActionInstruction.R_TRIG{GIF:HERE} - Screenshot showing a step named "StepName" with an action on "variable_name" using the R_TRIG (rising edge detection) instruction in the visual sequence editor
from automation_machine import Sequence, StepType, ActionInstruction
class Example(Sequence):
def setup(self):
step = self.add_step(StepType.INITIAL, name="StepName")
step.add_action("variable_name", "Description", instruction=ActionInstruction.R_TRIG)