Flip Flop and Something to think about

rta53

Lifetime Supporting Member
Join Date
Feb 2003
Location
North Carolina
Posts
619
This may surprise some of you more seasoned veterans, but I have been programming plcs for 15 years and can remember only one time having to use Flip Flop logic in my program. And actually I didn't even design this logic, I got it from a friend. Well today I found myself needing to do a Flip Flop and figured it would be rather simple, which it is, but after playing around with the logic a little I couldn't come up with a way of doing it that I liked. I thought, hey I will just logon to plcs.net and I will have my answer in seconds. I did get my answer, however it was not in a matter of seconds. I dutifully did my search for flip flop and got lots of hits. However the first 2 or 3 pages were filled mostly with posts containing lots of sarcasm and insults directed at stupid and lazy people who want someone else to do their work for them. I would love to belabor my point here but I need to get back to work. Suffice it to say I think some of you guys need to do the very thing you exhort others to do, which is use the search button, and see what comes up. I did and was unpleasantly surprised with what I got.

By the way, I did get my answer. I found a link, amongst all the stabs, to patchn.com and the example given by Ron. Very simple and works well. Finding it easily is another story.........

Randy Ayscue
 
I have been programming PLCs for almost 30 years and have never used a Flip-Flop in the program. Your point about the responses is well taken but you have to remember that what you read is out of context and time. Over any sufficient period, there are bound to be some objectionable posts on any forum, this one is no different. Follow your own advice as well as giving it to others.
 
I do understand your point about reading comments that are not necessarily in the proper context or time frame. I too get annoyed at times with seeing the same questions asked over and over without someone taking the time to search. However the main point I was trying to make was that, had I been a student or newbie searching for help on this topic, I would've had difficulity sorting through all the comments that were not really helpful in order to find my answer.
 
RTA53

I understood your point and I though it was relevant and quite a refreshing view on what we do here. For every search performed there will be so many valid answers plus a number of background noise answers. By simply telling people to go search, or criticising them for not having done it first, we're adding to the noise count without increasing the valid answer count.

Of course we may believe we are dealing with a deeper, truer problem than flip-flops, that of not searching. But sooner or later perhaps we should accept that if we've told 5000 people to search and they continue not to do it then the telling is not proving very effective.

Regards

Ken
 
i write logic to toggle bits all the time (usually around 64 toggle bits or so but depends on situation). i find it essential and i love it because it's very simple logic. what it does for me is provide plenty of settings to change behaviour of the machine from HMI (password protected of course). it always comes in handy to have bypass modes, enable-disable or whatever you want to call it. for up to 64 toggle bits i need no more than 4 rungs, each with just 2 or 3 instructions.
 
here is a sample of what i meant. each PB on HMI is momentary button and uses same bit number to write to plc and indicate status. if you are using AB PLCs you will have to waste one more bit or bool for OSR instruction. sorry for the orientation of the picture. there are some restrictions when it comes to picture size to please those with small displays, so i'm attaching one with more detail (ZIP).

tilted_toggle.jpg
 
panic mode said:
here is a sample of what i meant. each PB on HMI is momentary button and uses same bit number to write to plc and indicate status. if you are using AB PLCs you will have to waste one more bit or bool for OSR instruction. sorry for the orientation of the picture.
tilted_toggle.jpg
Why does your HMI not have a "Toggle" PB available, so no logic is needed?
 
There is a ton of information on flip flops or toggles here.

I did a search for my name and the word toggle and got 8 pages of matches. The problem is that I called them toggoles, not flip flops. Even in some of these threads I complain that I have posted the information before.

rat53, you do bring up a good point. Too much gets lost in the noise. I am more reluctant to post anything that takes effort because it does get lost in the noise. I know I am not going to anything like the Micrologix PID threads or the PID tuning on Excel again. No one knows they are there. I am more inclined now to contribute to the www.controlguru.com blog.

I think there needs to be Wiki section. There is a blog but it is already contaminated with non relevant info even if Sudoku is fun.
 
i never use maintained buttons on HMI (never needed one, i only program some 12-15kI/O a year).
also what happens if you power down machine or download new HMI file? you loose all settings, this is why imho they belong to controller.
 
Last edited:
Maybe I'm missing something?
In the HMI's that I am used to a 'toggle' turns a PLC bit 'on' if it's 'off' or 'off if it's 'on', I decide if the bit is to be 'retentive' (maintained through a PLC power cycle) or not. They are not affected by a download to the HMI, also I decide if a DL to the PLC will affect them.
A 'maintained' bit only stays 'on' so long as someone is touching the HMI button.
HTH
 
Why does your HMI not have a "Toggle" PB available, so no logic is needed?
In the HMI's that I have used ( Omron ) there is 4 actions associated with a button, 'momentary' , 'alternate' , 'set' , 'reset''.

Flip flops or toggles defenitly have there use, all depends on the application, and if it is required or not.

I also agree, searching for information can be a painstaking process, not just on this site, but the internet in general. You have to know and specify exactly what you are looking for then, it can be a hassle. I guess it is the way that the search engines work, on keywords. I still use google for most things though.
 
Since this is titled with FLIP-FLOP, One pushbutton etc lets offer some details on the subject. I have no idea now what my point was in my earlier response.

First let me say that I am one of the BUBBA’s you are referring too, just a maintenance man that happens to have some electronic background. Many of the people that come here are "students" that may or may not have an electronic background therefore using the word flip-flop is inappropriate. I respectfully submit that learning to understand what a flip-flop (bistable multivibrator) would be equal to learning how a one-shot works. I think all plcs these days have some form of one shot instruction. More on what a one shot is later.

Electronic flip-flops are bistable multivibrators that offer a form of one bit memory. There are 4 types, SR, D Latch, Toggle, and JK. The links below will provide more detailed information on flip-flops; the first link provides ladder diagrams equal to the flip-flop actions.

http://www.patchn.com/Digital/DIGI_10.html

http://en.wikipedia.org/wiki/Flip-flop_%28electronics%29

What Terry has created above I believe would be a D-Latch type flip-flop, the WAS bit is the equivalent to the E (enable) of the D-Latch flip-flop.

ONE SHOTS: What are they? They are a plc instruction that is only TRUE or ON for one scan of the plc. To understand "scan time" then look at what Phil Melore has provided here;

http://www.plcs.net/chapters/scan13.htm

There is also a section on One-shots; http://www.plcs.net/chapters/oneshot18.htm

There are differences between brands and different types.

Allen Bradley has ONS (one shot) and OSR (one-shot relay) instructions. Other brands use Positive or Negative differential which may be a contact or coil instruction and different methods for display i.e. (P), (N), (^) etc.

As mentioned before I have offered examples of flip flop or one pushbutton on/off on this page;
http://www.patchn.com/flipflop.htm

Note also that a flow chart diagram provided by Terry is also on that page.

Many PLCS today have "toggle" or "pulsed" instructions available, just take time to understand what your brand offers. I personally wish they did incorporate a "flip flop" instruction that was selectable between the 4 basic types. This is possible to develop in some cases.

The above discusses one pushbutton (one input) to latch on/off but what if you want an adjustable "pulsed output" (flasher). I have some AB examples on this page;
http://www.patchn.com/ab_plc_flasher.htm

Different brands use timers differently so you have to understand the timers for your brand. The first example using 2 timers should be easy to convert to other brands.

This has also been posted in this thread; http://www.plctalk.net/qanda/showthread.php?t=22175
 

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,455
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,887
I found and fixed issue. B3:3 was used in MOV.
Replies
11
Views
2,555
I am calculating power factor from samples of voltage and current. Calculation is done by multiplying voltage and current samples. What Im...
Replies
0
Views
1,632
Hi all, my first post here, I've been lurking for a while. I'm a beginner and I hit a wall on one of my first projects I'm working on. I know it...
Replies
6
Views
2,529
Back
Top Bottom