F_TRIG (Falling Edge Detection)
Detects a falling edge (TRUE-to-FALSE transition) on a monitored input and produces a single-cycle pulse on the action's output variable.
Description
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. PulsesTRUEfor 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:
- Detecting button releases
- Counting off-to-on transitions of inverted signals
- Triggering actions when a condition ends
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.
Syntax
- name: the output variable name (pulsed for one cycle on each falling edge)
- description: human-readable description of the action
- qualifier:
ActionQualifierenum (default:ActionQualifier.N) - instruction:
ActionInstruction.F_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",
"Falling edge of input_signal",
instruction=ActionInstruction.F_TRIG,
operands=[ActionOperand("input_signal")],
)
See Also
- R_TRIG (Rising Edge Detection): detects TRUE transitions
- SR (Set-Reset Flip-Flop): latch an edge result
- Action Qualifiers Overview
- Instructions Overview