RS (Reset-Set Flip-Flop (Reset-Dominant))
A reset-dominant flip-flop that latches FALSE when the reset input is active.
Description
The RS instruction implements a reset-dominant flip-flop, as defined in IEC 61131-3. It has two inputs: Reset (R) and Set (S). When both inputs are TRUE simultaneously, the Reset input wins and the output is FALSE.
Behavior summary:
- S = TRUE, R = FALSE: output becomes
TRUE - S = FALSE, R = TRUE: output becomes
FALSE - S = TRUE, R = TRUE: output becomes
FALSE(reset-dominant) - S = FALSE, R = FALSE: output retains its previous value
Use RS when the "off" condition must take priority over the "on" condition, which is common in safety-critical applications where stopping must always override starting.
For safety-critical outputs (e.g., emergency stop),
RS(reset-dominant) is generally the safer choice.
Syntax
- name: the output variable name (the latch the flip-flop maintains)
- description: human-readable description of the action
- qualifier:
ActionQualifierenum (default:ActionQualifier.N) - instruction:
ActionInstruction.RS - operands:
[ActionOperand("set_input"), ActionOperand("reset_input")](operand[0]is the Set input,operand[1]is the Reset input)
RSrequires both operands. Without them, S and R both default toFALSEand the latch never moves. The Sequence visual editor and the runtime both warn when operands are missing.
Syntax
Sequence Visual Editor

The first chip is the set input, the second the dominant reset 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(
"latch_var",
"Reset-dominant latch driven by start/stop buttons",
instruction=ActionInstruction.RS,
operands=[
ActionOperand("start_btn"),
ActionOperand("stop_btn"),
],
)
See Also
- SR (Set-Reset Flip-Flop): set-dominant version
- S (Set / Stored Qualifier): simple latch on
- R (Reset Qualifier): simple latch off
- Action Qualifiers Overview
- Instructions Overview