![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|||||||
![]() |
If you're really looking to learn about PLCs, you NEED our book... "Your Personal PLC Tutor - A Guide to Understanding PLCs" Easy to read and uses 'plain' language!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
![]() Join Date: Apr 2002
Posts: 3,170
|
FLIP-FLOP or FLIPFLOP or FLIP FLOP or TOGGLE or ONE BUTTON or ONE-BUTTON
FLIP-FLOP or FLIPFLOP or FLIP FLOP or TOGGLE or ONE BUTTON or ONE-BUTTON
This will work in ANY PLC. It is the "generic" solution for any PLC. It's only four Rungs in length and is totally transparent, to ANY PLC user, even Bubba! (OSR's can be confusing to some.) The Flipping (Toggling) action takes place in only one scan. This Rung watches for the PB to be pressed. When the PB transitions from NOT Pressed (OFF) to Pressed (ON), "FLIP-BIT" goes ON to flip the "TARGET BIT". "FLIP BIT" goes ON for no more time than it takes to scan the next two Rungs. And possibly, for as little time as it takes to scan the next one Rung. SET-ting "WAS PB" prevents "FLIP BIT" from being re-activated, in subsequent scans, while the PB is still being pressed.
If the PB is just-now pressed, and the "TARGET BIT" is ON, then "TARGET BIT" is RESET (Turned OFF). Then, the driving signal, "FLIP BIT", is RESET (Turned OFF). If "FLIP BIT" is turned OFF in this Rung, then the next Rung is prevented from operating on the "TARGET BIT".
If the PB is just-now pressed, and "FLIP BIT" is still ON (not RESET in the previous Rung), and "TARGET BIT" is OFF, then "TARGET BIT" is SET (Turned ON). Then, the driving signal, "FLIP BIT", is RESET (Turned OFF). Since "WAS PB" was SET (Turned ON), Rung-1 is prevented from being activated.
When the signal from PB finally goes OFF, after having been ON ("WAS PB" is ON), then run that pair of conditions through a short-termed Timer (1-second). After timeout, RESET (Turn OFF) "WAS PB". That produces a "debouncing" effect. When "WAS PB" goes OFF, the first Rung is allowed to "watch" for the next pressing of PB.
. |
|
|
|
#2 | |
|
Member
|
Quote:
I guess Terry has settled the background noise for a month!?
__________________
Mark A. Crowley Automation is not a corrective action for a lack of discipline. |
|
|
|
|
#3 |
|
Member
|
4 rungs for a flip flop?
Personally I disagree with the use of the term flip flop. In many cases the descripton of one input used to alternatte an output is called a JK flip flop...that is just wrong. One rung with many branches is not innovative..especially when talking about an S7-200...it has a "toggle" instruction. I posted examples of "toggle" or flip flop with Terry's flowchart to help. Flip flop's are electronic devices used for a specific purpose, a PLC can simulate it BUT it is not one...it can do more.
__________________
http://www.patchn.com Industrial Electrical & Maintenance @ www.patchn.com "Tell me and I forget, show me and I remember, involve me and I understand." Last edited by rsdoran; April 22nd, 2006 at 12:58 AM. |
|
|
|
#4 |
|
Member
![]() Join Date: Apr 2006
Location: East Texas
Posts: 42
|
This AB logic. It is a simple toggle !st time input is true CTU=1 Output is on 2nd time input is true CTU=2,resets,CTU=0 Output is off Is there an easier way to post pics or drawings? Thanks |
|
|
|
#5 |
|
Member
|
Our you can do it like this,
![]() You can call it...JK-Flip-Flop, RS-Flip-Flop, JFK-Flip-Flop What ever you want, as long as your output is true when you want it to be. PS. Tsmith... my neck hurts ![]() edit: I cant seem to get the pic to insert??, but here is a PDF Edit: Got it...you must read, hmmm
__________________
www.PLCTrainer.net PLC Trainers, Communication Cables and Automation Supplies, ((NEW)) Siemens S7 1200 trainers Last edited by geniusintraining; April 22nd, 2006 at 10:01 AM. |
|
|
|
#6 |
|
Member
![]() Join Date: Apr 2002
Posts: 3,170
|
"I guess Terry has settled the background noise for a month!?"
Apparently not. Yes Ron, there are indeed four rungs. Ron... A rose by any other name is still a rose. I just used what seemed to be the most common names for the sake of searching. The point of my post was to present a "flip-flop-toggle-whatever-thingee" that would work in ANY PLC. The only element that might be considered exotic is the timer. However, even Smart Blocks (Smart Relays) have timers. I've always been bothered by brand-specific solutions. A solution created for a particular brand of PLC might be so unique that it can't be applied to other PLCs. This code will apply to any PLC. Any programmer can read it and understand it. The concept is apparent. Having understood the concept... any programmer can then use those unique tools in his particular tool-box to realize the concept in any manner he wishes... or, with only one caveat, he can use the code exactly as I have presented it. The caveat is in regards to the timer. It appears that most PLCs handle timers differently. So, apply the timer in the manner required for your particular PLC. "One rung with many branches is not innovative..especially when talking about an S7-200...it has a "toggle" instruction." One rung? I thought we just agreed that it was four rungs. S7-200? I thought I made it clear that this code is for use in ANY PLC. So Ron... what's your point? (From "Never-Never-Land"... where believing in yourself can produce some pretty amazing results!) |
|
|
|
#7 |
|
Member
![]() Join Date: Apr 2002
Location: WI
Posts: 1,132
|
Terry,
Look at your third rung. The logic does do not match with the description. Shouldn't it be |---+---(SET) TARGET-BIT ? |
|
|
|
#8 |
|
Member
![]() Join Date: Apr 2002
Posts: 3,170
|
The best laid plans of mice and men...
Damn it Jim! You are so right. FLIP-FLOP or FLIPFLOP or FLIP FLOP or TOGGLE or ONE BUTTON or ONE-BUTTON This will work in ANY PLC. It is the "generic" solution for any PLC. It's only four Rungs in length and is totally transparent, to ANY PLC user, even Bubba! (OSR's can be confusing to some.) The Flipping (Toggling) action takes place in only one scan. This Rung watches for the PB to be pressed. When the PB transitions from NOT Pressed (OFF) to Pressed (ON), "FLIP-BIT" goes ON to flip the "TARGET BIT". "FLIP BIT" goes ON for no more time than it takes to scan the next two Rungs. And possibly, for as little time as it takes to scan the next one Rung. SET-ting "WAS PB" prevents "FLIP BIT" from being re-activated, in subsequent scans, while the PB is still being pressed.
If the PB is just-now pressed, and the "TARGET BIT" is ON, then "TARGET BIT" is RESET (Turned OFF). Then, the driving signal, "FLIP BIT", is RESET (Turned OFF). If "FLIP BIT" is turned OFF in this Rung, then the next Rung is prevented from operating on the "TARGET BIT".
If the PB is just-now pressed, and "FLIP BIT" is still ON (not RESET in the previous Rung), and "TARGET BIT" is OFF, then "TARGET BIT" is SET (Turned ON). Then, the driving signal, "FLIP BIT", is RESET (Turned OFF). Since "WAS PB" was SET (Turned ON), Rung-1 is prevented from being activated.
When the signal from PB finally goes OFF, after having been ON ("WAS PB" is ON), then run that pair of conditions through a short-termed Timer (1-Second). After timeout, RESET (Turn OFF) "WAS PB". That produces a "debouncing" effect. When "WAS PB" goes OFF, the first Rung is allowed to "watch" for the next pressing of PB.
Last edited by Terry Woods; April 22nd, 2006 at 03:31 PM. |
|
|
|
#9 |
|
Member
![]() Join Date: Apr 2002
Location: WI
Posts: 1,132
|
I Like my MGD room temp and served in a frozen mug.
|
|
|
|
#10 |
|
Member
![]() Join Date: Apr 2002
Posts: 3,170
|
Jim,
Do you try to develop a large head? Or do you pour it down the side? I go for no head! |
|
|
|
#11 |
|
Member
|
An even more universal solution. No Set/Resets. No Latch/Unlatch. No Counters. No Timers. No Time delay to deal with.
1) Target and R1 starts out both off 2) PB is pressed and held. Only R1 is on 3) PB is released. Both R1 and Target are on 4) PB is pressed and held. R1 drops out 5) Button is released. Both R1 and Target are off as in step 1 Last edited by Archie; April 22nd, 2006 at 06:49 PM. Reason: Ladder was showing wrong |
|
|
|
#12 |
|
Member
![]() Join Date: Jun 2002
Location: Auckland
Posts: 1,130
|
How about this for generic.
Some very basic / stone-age PLC's don't support multiple outputs on a rung. And even those have input filtering, so a debounce is redundant (unless the operator has Parkinson's). Still 4 rungs though
Slightly less generic using output branching: Down to 2 rungs. (This one's better if I/O is asynchronous)
Last edited by Gerry; April 22nd, 2006 at 06:59 PM. Reason: Archie types faster (no change) |
|
|
|
#13 |
|
Member
![]() Join Date: Apr 2006
Location: East Texas
Posts: 42
|
I agree with the concept of less rungs is better. I do not have the experience of the major posters here, but I learned early on, you can get so fancy that it does't work.
|
|
|
|
#14 |
|
Member
![]() Join Date: Apr 2002
Location: WI
Posts: 1,132
|
Tsmith said "you can get so fancy that it does't work" - well put.
Terry, If the brewmaster had intended the beer to be flat, he wouldn't have put in the bubbles in the first place. |
|
|
|
#15 |
|
Member
![]() Join Date: Apr 2002
Posts: 3,170
|
Archie,
Yours will work, however, isn't it kinda weird to operate a light or motor by "releasing" a push-button? And it is not exactly what I would call easy to decipher. Bubba would probably get dizzy trying to figure it out. And by the way Archie, the conditions that cause the need for "debouncing" should not be considered frivolous. Gerry, Neither of yours will ever work in the vast majority of PLCs. If the light is ON you can turn it OFF.. however, the problem is that the light can never be turned ON! Gerry said... "Some very basic / stone-age PLC's don't support multiple outputs on a rung. And even those have input filtering, so a debounce is redundant (unless the operator has Parkinson's)." Gerry, if you were hired to create a One-Button Toggle-Function that would work in ANY PLC, would your statement have any validity at all? Notice that the key-word is "ANY"... that would include all of those "...very basic / stone-age PLC's...". Even those that don't have built-in filtering! Jim... Since I paid for those bubbles... I prefer to keep them for myself rather than letting them bubble away into the atmosphere! If ya can't get a good healthy buuuurrrrp.... out of them bubbles, then what the hell is the point of havin' 'em? Last edited by Terry Woods; April 23rd, 2006 at 09:29 AM. |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flip Flop and Something to think about | rta53 | LIVE PLC Questions And Answers | 13 | April 24th, 2006 08:16 AM |
| Question for S7 Guy or another XOR flip flop expert! | 504bloke | LIVE PLC Questions And Answers | 2 | March 15th, 2006 07:26 AM |
| flip flop logic | Unregistered | LIVE PLC Questions And Answers | 12 | May 1st, 2005 08:59 PM |
| Flip flop or toggle: a rehash | rsdoran | LIVE PLC Questions And Answers | 8 | January 29th, 2003 02:58 PM |