flip flop logic

Unregistered

Guest
U
how can i create a flip flop in ladder logic? It needs to be triggered by one input and has two out puts that flip flop with no time limit for each output.
Input turns one output on and when it goes off the next time the input comes on the the other output comes on.......ect
 
Search and ye shall find!

Use the search feature on this site and look for posts and threads on the subject. This is the flip-flop, traffic light and NPN-PNP site of all time. More space has been dedicated to these topics than nearly all else. I think!
 
I added the safety light as added security... But not a good idea starting and stopping somthing with just one input....

SampleFlip.jpg


I think this will work in most cases...

if others think not just tell me why, please...
 
Check out the attahced PDF file.

I prefer and usually use the method shown in the first rung. It is a single rung implementation of a flip flop and it incorporates flip flop reset logic in the same.

The second shows another way you could do it with a counter. I just threw those on real quick to show how it could be done. The LSB of your counter accumulator changes state each time the coutner increments its value by one (binary counting). I've seen this method used quite a bit, the rungs are simple.
 
DanielCamacho said:
I added the safety light as added security... But not a good idea starting and stopping somthing with just one input....

SampleFlip.jpg


I think this will work in most cases...

if others think not just tell me why, please...

Daniel, I've seen similar implementations, but I can spot a problem with this one. Assuming that you are starting with the pump output off, when the button is pushed the top line of rung 0 will solve true just fine and turn on your pump output. Now lets solve the branch. We have just set O:2/0, so the first instruction on the branch will evaluate as true and then the OTU instruction will immediately clear O:2/0. Remember that while the actual outputs are not updated until the end of a scan, the output data table is updated immediately.

To make this work a third bit is required. A OTE instruction must be placed in a parallel branch round the OTL instruction in the top branch. This bit will then be on for a single scan when O:2/0 is turned on. Then in the lower branch that same bit is referenced with an XIO instruction just before the OTU instruction.

Look at the first rung in the PDF file attached to my previous post in this thread to see a different way.

I agree that it is better to start and stop with two inputs whereever possible, and the stop input should come from a N/C contact, so that if the input power goes away, you still get a stop signal.
 
Last edited:
"Cat Skinning Method #42 & #43."

There are MANY ways to skin this cat... here are just two...

METHOD 42: Only for those PLC's that can do that damned "RE-what-cha-ma-call-it". (We never have settled on a name for this particular concept! But, I'm feeling more strongly that the concept is called "Re-Entry".)

WAS
PB PB
---| |---+---|/|------------+-----( SET ) WAS PB
| |
| +-----( SET ) FLIP
|
| FLIP OUT_1
+---| |-----| |----+-----( RST ) OUT_1
| |
| +-----( SET ) OUT_2
| |
| +-----( RST ) FLIP
|
| FLIP OUT_1
+---| |-----|/|----+-----( SET ) OUT_1
|
+-----( RST ) OUT_2
|
+-----( RST ) FLIP

WAS
PB PB +-------+
---|/|-----| |----+ TIMER +------( RST ) WAS PB < --- This is a "debouncer" for the PB.
| 1-Sec | Not necessary if using a good snap-switch.
+-------+ If so, simply remove the "Timer"
but keep the rung.



METHOD 43: For those PLC's that can not do that damned "RE-what-cha-ma-call-it".

WAS
PB PB
---| |-----|/|----+-----( SET ) WAS PB
|
+-----( SET ) FLIP

FLIP OUT_1
---| |-----| |----+-----( RST ) OUT_1
|
+-----( SET ) OUT_2
|
+-----( RST ) FLIP

FLIP OUT_1
---| |-----|/|----+-----( SET ) OUT_1
|
+-----( RST ) OUT_2
|
+-----( RST ) FLIP

WAS
PB PB +-------+
---|/|-----| |----+ TIMER +------( RST ) WAS PB < --- This is a "debouncer" for the PB.
| 1-Sec | Not necessary if using a good snap-switch.
+-------+ If so, simply remove the "Timer"
but keep the rung.





Not to worry about using SET/RST in this context... these SETs and RSTs are self-correcting.
 
Alaric, welcome... and regarding your post above, and Daniels, you, Alaric, are 100% correct.

Daniel (no offense intended) makes assumptions based on the sequence of operand evaluation. That **MAY** work, on some platforms, but may (probably) NOT work on others.

Not that I want to moralize, but you really shouldn't rely on any particular platform (PLC, Operating System) to exibit quirks that you enjoy. Rather, take the extra bit, and the extra logic, to try to ensure that any logic you develop works on ANY platform.

Scan time really doesn't get hurt by an extra couple of rungs of ladder logic (pure boolean logic), so there is little reason to eek out every possible microsecond in a routine which makes it PLC Operating System dependent.

IMHO, of course.
 
If this does not bring Terry out of the Woods' (pun intended) then nothing will :)

((744))

Like seeing Ron as a lifetime supporting member.... he posted enough and helped for a few lifetimes (thanks Phil, nice touch)
 
Last edited:

Similar Topics

I am having this issue trying to figure out how to do this. I have a Hydraulic ram that travels when a machine is running. The ram extends to the...
Replies
31
Views
9,518
Hi, i am trying to use a different method of using one pushbutton to start/stop a system. I know how to do it using two rungs and a one shot. I...
Replies
12
Views
9,110
C
where can i see some sample logic looking for a momentary input/"maintianed on state" then the same momentary input for fot the maintained off...
Replies
46
Views
33,786
Hi everyone, I'm learning ladder logic and have built a flip flop circuit (see pic) from an online tutorial. Closing the switch A is meant to...
Replies
19
Views
6,931
I found and fixed issue. B3:3 was used in MOV.
Replies
11
Views
2,583
Back
Top Bottom