Toggle menu

Programming a Flip Flop in a PLC (one button to turn on and same button to turn off logic)

Posted by Mark ( on Nov 17, 2019

A lot of the time in electrical work (maintenance or engineering) you are limited either by time, physical connection or just lack of having the correct parts on hand. First example you may have a machine down and you are pressed for time to get it up and running... therefore you dont have the luxury of time and you need to think of a 'work around' to get the machine back up and running, on this hypothetical down machine you have a push button and you need to start a action (turn on motor) but this is a momentary push button and you need it to also turn the motor off, you dont have the room for another push button on the enclosure, or you only have one free input to the PLC and dont have the time to run wires for a new one and install another I/O card... these examples you need the ONE button to do more than one thing and this is where the Flip-Flop logic comes into play.

There are many different ways of doing this and there really is no right or wrong way IF the logic works, some PLC's have features that others dont like a one-shot, set re-set, use of counters, timers, etc. 

On user forum (Live PLC Q&A) there have been many good discussion on how to achieve this, a classic

For RSLogix 500 we have done this, the thought behind this is, in rung 0000 your input 1:0/2 will index a count up timer that timer will trigger the output in the second rung 0001 everytime the counter equals the value of 2 the output will be true and the counter is reset in the 3rd rung 0002 and is reset 

Archie give a good example in the 11th post but TConnolly improved my logic better in post 26, you can see from the truth table in his post if you look at any one bit it will change from 0 to 1 and back to 0.

PeterW posted a Step7 Siemens version in post 37 that looks great 

These examples are only a few ways of getting it done and our hopes is that this will help you think outside of the box in your PLC programming.