A set-dominant flip-flop that latches TRUE when the set input is active.
The SR instruction implements a set-dominant flip-flop, as defined in IEC 61131-3. It has two inputs: Set (S) and Reset (R). When both inputs are TRUE simultaneously, the Set input wins and the output is TRUE.
Behavior summary:
TRUEFALSETRUE (set-dominant)Use SR when the "on" condition must take priority over the "off" condition in conflict situations.
If you need the reset to take priority instead, use the RS - Reset-Set Flip-Flop.
ActionQualifier enum (default: ActionQualifier.N)ActionInstruction.SR{GIF:HERE} - Screenshot showing a step named "StepName" with an action on "variable_name" using the SR (set-reset flip-flop) 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.SR)