The SR Latch
Part of the Latches, Edges and Interlocks section of Coddy's PLC Programming journey. Lesson 5 of 20.
A latch is so common that IEC 61131-3 has it as a box. The SR box takes the rung's power on its S1 input (set), and its R input (reset) is a tag you name. Its output Q1 turns TRUE on a set and stays TRUE until a reset.
Every box has an instance name, here L1: its own memory, so two boxes never mix up.
When S1 and R are both TRUE, SR sets: it is set dominant. The 1 in S1 marks the input that wins. That suits an alarm: while the alarm is still there, nobody can clear its lamp.
Challenge
EasyPB1 is an alarm contact. Light Red with an SR box: PB1 sets it, PB2 resets it. While PB1 is held, PB2 must not clear Red.
Try it yourself
{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[]}]}All lessons in Latches, Edges and Interlocks
Practice on your own: PLC playground