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
| Name | Type | Description |
|---|---|---|
| S1 | BOOL | Set input (dominant) - sets Q1 to TRUE |
| R | BOOL | Reset input - resets Q1 to FALSE |
Outputs
| Name | Type | Description |
|---|---|---|
| Q1 | BOOL | Bistable 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
Siemens (TIA Portal)
Use SR instruction in TIA Portal. Also available as Set/Reset coils in ladder logic.
Allen-Bradley (Studio 5000)
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).
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).
Related Function Blocks
RS (Reset-Set Flip-Flop, Reset Dominant)
Reset-dominant flip-flop: reset wins if both set and reset are active simultaneously.
View Reference →R_TRIG (Rising Edge Detection)
Detects FALSE-to-TRUE transition, outputs single-scan pulse on rising edge.
View Reference →F_TRIG (Falling Edge Detection)
Detects TRUE-to-FALSE transition, outputs single-scan pulse on falling edge.
View Reference →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.
Instant download - 30-day money-back guarantee - Use on unlimited projects