Rising Edges
Part of the Latches, Edges and Interlocks section of Coddy's PLC Programming journey. Lesson 7 of 20.
A button press lasts maybe 300 ms: 30 scans. Sometimes a program should act only once, at the moment of the press. That moment is the rising edge: the scan where the tag goes from FALSE to TRUE.
A rising edge contact, drawn with a P, passes power for that one scan only. It remembers the tag from the last scan and compares. Hold PB1 and press Step one scan: the contact passes power once, then not again until the next press.
Challenge
EasyHere, holding PB1 sets Green on every scan, so PB2 cannot turn it off. Change the PB1 contact to a rising edge contact. Then hold PB1, press PB2, and Green stays off.
Try it yourself
{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[{"t":"no","tag":"PB1"},{"t":"set","tag":"Green"}]},{"els":[{"t":"no","tag":"PB2"},{"t":"reset","tag":"Green"}]}]}All lessons in Latches, Edges and Interlocks
Practice on your own: PLC playground