Detects a falling edge (TRUE-to-FALSE transition) on a monitored input and produces a single-cycle pulse on the action's output variable.
The F_TRIG instruction watches the boolean variable passed as its operand for a falling edge - the moment that signal transitions from TRUE to FALSE. 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. Pulses TRUE for one cycle on each falling edge.operands[0] - the input signal monitored for the falling edge.This is useful when you need to react to a signal turning off, such as detecting when a button is released or when a sensor loses its target.
Typical uses include:
F_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.
ActionQualifier enum (default: ActionQualifier.N)ActionInstruction.F_TRIG[ActionOperand("input_signal")] - the boolean variable to monitor{GIF:HERE} - Screenshot showing a step named "StepName" with an action on "edge_var" using the F_TRIG (falling edge detection) instruction, with the watched input variable specified in the operand field
from automation_machine import Sequence, StepType, ActionInstruction, ActionOperand
class Example(Sequence):
def setup(self):
step = self.add_step(StepType.INITIAL, name="StepName")
# `edge_var` pulses TRUE for one cycle whenever `input_signal` goes 1 -> 0.
step.add_action(
"edge_var",
"Falling edge of input_signal",
instruction=ActionInstruction.F_TRIG,
operands=[ActionOperand("input_signal")],
)
# Reference the output in a transition condition:
# self.add_transition(step, next_step, "edge_var")