Learn PLCs free
Bistables & Edge DetectionBeginnerIEC 61131-3

SR (Set-Reset Flip-Flop, Set Dominant)

Set-dominant flip-flop: output latches TRUE on set, cleared by reset. Set wins if both active.

The SR (Set-Reset) bistable function block is a set-dominant flip-flop. When the Set input (S1) is TRUE, the output (Q1) goes TRUE. When the Reset input (R) is TRUE, Q1 goes FALSE. If both S1 and R are TRUE simultaneously, the set input takes priority and Q1 remains TRUE. The SR flip-flop retains its state when both inputs are FALSE. SR bistables are used for latching operations where the set condition should override the reset, such as alarm latching, start/stop circuits, and fault indication.

Parameters

Inputs

NameTypeDescription
S1BOOLSet input (dominant) - sets Q1 to TRUE
RBOOLReset input - resets Q1 to FALSE

Outputs

NameTypeDescription
Q1BOOLBistable output

Ladder Logic Example

// Ladder Logic - SR Flip-Flop (Alarm Latch)
//
// |----[ Alarm_Input ]------( S )-- Alarm_Latch ---|  Set
// |----[ Ack_Button ]-------( R )-- Alarm_Latch ---|  Reset
// |----[ Alarm_Latch ]------( Alarm_Light )--------|

Structured Text Example

VAR
    Alarm_Latch : SR;
    Alarm_Input : BOOL;
    Ack_Button : BOOL;
    Alarm_Active : BOOL;
END_VAR

Alarm_Latch(S1 := Alarm_Input, R := Ack_Button);
Alarm_Active := Alarm_Latch.Q1;

20 Production-Ready Ladder Logic Templates

Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.

Platform-Specific Implementation

S

Siemens (TIA Portal)

Use SR instruction in TIA Portal. Also available as Set/Reset coils in ladder logic.

AB

Allen-Bradley (Studio 5000)

Use OTL (Output Latch) and OTU (Output Unlatch) instructions. Set-dominant by rung order.

C

CODESYS

Standard SR in Standard library. Set input is S1 (dominant).

Common Applications

  • Alarm latching
  • Start/stop motor circuits
  • Fault indication
  • Mode selection latches
  • First-out annunciator

Common Mistakes to Avoid

  • Confusing SR (set dominant) with RS (reset dominant)
  • Not understanding latch behavior across power cycles

Frequently Asked Questions

What is SR (Set-Reset Flip-Flop, Set Dominant) in PLC programming?

Set-dominant flip-flop: output latches TRUE on set, cleared by reset. Set wins if both active. The SR (Set-Reset) bistable function block is a set-dominant flip-flop. When the Set input (S1) is TRUE, the output (Q1) goes TRUE.

What are common applications of SR (Set-Reset Flip-Flop, Set Dominant)?

SR (Set-Reset Flip-Flop, Set Dominant) is commonly used for: Alarm latching, Start/stop motor circuits, Fault indication, Mode selection latches, First-out annunciator.

How do I use SR (Set-Reset Flip-Flop, Set Dominant) in different PLC platforms?

Siemens: Use SR instruction in TIA Portal. Also available as Set/Reset coils in ladder logic. Allen-Bradley: Use OTL (Output Latch) and OTU (Output Unlatch) instructions. Set-dominant by rung order. CODESYS: Standard SR in Standard library. Set input is S1 (dominant).

Stop Writing Ladder Logic From Scratch

Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.

20
Ready-Made Templates
LD + ST
Both Languages Included
$29
One-Time Purchase
Get Instant Access -- $29

Instant download - 30-day money-back guarantee - Use on unlimited projects

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →