You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 23rd, 2006, 09:12 AM   #16
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is online now
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,283
Gerry - your examples may work on a Modicon with its 'by column scan' but for most others the "Toggle" will end up being unlatched alll the time. After it is latched (possibly) the test on the next rung, or the next branch of your second example, will see "Toggle" as latched then unlatch it again. Terry was proposing a processor independent format.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old April 23rd, 2006, 09:45 AM   #17
elevmike
Member
United States

elevmike is offline
 
elevmike's Avatar
 
Join Date: Feb 2004
Location: Detroit, MI
Posts: 4,012
Riddle,

How many posts does it take to debate a flip flop??
__________________
If you think you can do a thing or think you can't do a thing, you're probably right.... Henry Ford
  Reply With Quote
Old April 23rd, 2006, 09:54 AM   #18
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
I think that might be a trick question!

My answer is... uummm... "TRUE"!

No wait! "FALSE"!

No wait... damn it! I knew this was a trick question!

No, it's not! YES, IT IS!

See, I told ya Casey... "apparently not".

Last edited by Terry Woods; April 23rd, 2006 at 09:56 AM.
  Reply With Quote
Old April 23rd, 2006, 10:52 AM   #19
Pego
Member
Netherlands

Pego is offline
 
Join Date: Feb 2005
Posts: 117
Smile

Quote:
Originally Posted by Terry Woods
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.
No it is not weird, you only have to understand that R1 is the "toggle bit"
Bubba understands it Do you you?
  Reply With Quote
Old April 23rd, 2006, 11:22 AM   #20
rsdoran
Lifetime Supporting Member
United States

rsdoran is offline
 
rsdoran's Avatar
 
Join Date: Apr 2002
Location: Birmingham, AL
Posts: 7,372
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/showthr...764#post153764

__________________
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 23rd, 2006 at 11:26 AM.
  Reply With Quote
Old April 23rd, 2006, 11:55 AM   #21
Archie
Member
United States

Archie is offline
 
Archie's Avatar
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 894
Quote:
Originally Posted by Terry Woods
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.
Terry,

The "on after release" is very easily changed by replacing all R1's with Target, and all Target's with R1.

As for debouncing, yes there will be a problem if your PLC scans faster than the settle time of a switch. My experience is that PLC's typically operate in the 10ms scan range and most switch bounce is settled after a few hundred microseconds.

And note that I did not say ALL!

The solution does seem complex and hard to follow, but if you see the origin, it all then makes sense. Getting to the solution is much more interesting that the solution itself. This logic was derived using a state transition diagram with grey code defining each state, then minimizing the logic. Ohhh the days of designing electronic digital logic circuits.
  Reply With Quote
Old April 23rd, 2006, 04:27 PM   #22
Gerry
Member
New Zealand

Gerry is offline
 
Join Date: Jun 2002
Location: Auckland
Posts: 1,141
Red face

Quote:
Originally Posted by bernie_carlton
Gerry - your examples may work on a Modicon with its 'by column scan' but for most others the "Toggle" will end up being unlatched alll the time. After it is latched (possibly) the test on the next rung, or the next branch of your second example, will see "Toggle" as latched then unlatch it again. Terry was proposing a processor independent format.
DANG
You're absolutely right of course - that would be why I normally just use a counter.
However, I do like that multi-bit XOR solution on the other FF thread.
  Reply With Quote
Old April 24th, 2006, 05:07 AM   #23
rta53
Lifetime Supporting Member
United States

rta53 is offline
 
rta53's Avatar
 
Join Date: Feb 2003
Location: North Carolina
Posts: 600
Terry,

Thanks for hijacking my thread. Like we needed to start another one on flip-flops. But I guess this is par for the course for me.

And Ron. I couldn't figure out at first what you meant by "bubba" when you posted in my thread. Then I saw that you were responding to a post in Terry's thread. I guess I could call myself a "bubba" too since I came in the back door of PLC programming. 20 years ago I was crawling around under houses as a residential electrician. Now I sit in front of a computer most of the day designing control panels in AutoCad and\or doing PLC programming.

Also thanks for your example of the flip-flop circuit. I used it in my program.

Sorry if this post seems a little whiney. May be the result of working 65 to 70 hours per week for the last 4 months.
  Reply With Quote
Old April 24th, 2006, 01:30 PM   #24
markhommer
Member
United States

markhommer is offline
 
Join Date: Jan 2006
Location: Wichita,KS
Posts: 11
I'm new to this forum, so please excuse me if this example of Toggle-Toggle (or flip-flop) has been posted. This is what I use. One advantage is that the Toggled Bit (IND) will un-toggle when the PLC goes to program mode. In the second rung, you can easily add permissives like E-stops or guards closed. There may be some plcs that this logic is not possible. For me, this logic seems very intuitive and easy to explain to new programmers.




Regards,
Mark.
  Reply With Quote
Old April 24th, 2006, 02:39 PM   #25
geniusintraining
Lifetime Supporting Member + Moderator
United States

geniusintraining is offline
 
geniusintraining's Avatar
 
Join Date: Jun 2005
Location: SC
Posts: 3,771
Welcome to the fourm Mark & I like it.
Quote:
From markhommer




Quote:
Originally Posted by rta53
Sorry if this post seems a little whiney. May be the result of working 65 to 70 hours per week for the last 4 months.
Are you working part time????
__________________
www.PLCCable.com Save 5% on all cables and trainers, enter coupon code PLCTalk at check out... see our NEW line of PLC programming cables, smaller, cheaper, better....
  Reply With Quote
Old April 24th, 2006, 03:09 PM   #26
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,816
Quote:
Originally Posted by TSmith


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

Now thats what I call doing it the hard way.

Lets take a look at the counter ACC. Pay attention to what the LSB is doing in binary:
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000

Do you notice anyting about the ACC/0 bit? Notice how each time the counter upcounts, the value of the ACC/0 changes state.

If you are hell bent on using a counter to implement a flip flop then skip all of the resets and the EQU compare instruction - these all consume cpu cycles.

Forget about the actual value of the ACC or the preset or the DN bit or even counter roll over, the only bit that matters is the ACC/0 bit. BTW, when using a counter as a flip flop you create a retentive flip flop, so be very careful.
  Reply With Quote
Old April 24th, 2006, 03:15 PM   #27
TSmith
Member
United States

TSmith is offline
 
Join Date: Apr 2006
Location: East Texas
Posts: 42
Hi Alaric,

Thanks, I do like that better
  Reply With Quote
Old April 24th, 2006, 06:17 PM   #28
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
Gee...

All of the "heros" out there seem to ignore the primary stipulation...

What part of "ANY PLC" do you not understand?

Most of you have come up with a "brand-specific" solution!
Some are "function-specific" (again, brand specific).
Some are just... "cute", however, none of them are universal.

Obviously, very few of you, if any, have been "around-the-block" enough to realize that there are more PLCs out there than your own particular favorite brand!

Some of those other PLCs are more capable, some of them are less capable.
BELIEVE IT OR NOT!!! Not all PLCs are as capable as your personal favorite!

My solution will apply to "ANY PLC"!

Yours will not.

Don't you get it???

And to you, rta53...

I didn't "hijack" your thread. "Hijacking" occurs within the thread. I simply started a new thread, of my own, that directly addressed the search-issue and the universal-solution-issue.

Do you have a problem with me helping those that don't have your particular favorite brand?

If so... too bad. This ain't the rta53 site.

Don't take it personally... except to the extent that you really need to reconsider your attitude about this issue.

Damn! I hate using sharp daggers! But sometimes...
  Reply With Quote
Old April 24th, 2006, 08:17 PM   #29
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,816
Quote:
Originally Posted by Terry Woods

My solution will apply to "ANY PLC"!

Yours will not.

Don't you get it???
Terry, FYI, we do get it.

But why bother to re-construct what some PLCs already have? That kind of negates any advancement in instruction sets.
Followed to its logical consclusion (pun intended), shall we throw out every single instruction except AND, OR, NOT, and XOR?
  Reply With Quote
Old April 24th, 2006, 08:54 PM   #30
scottmurphy
Member
New Zealand

scottmurphy is offline
 
Join Date: Oct 2004
Posts: 363
What about not using SET / RESET or OS instructions?

Again though, most PLC's have these instructions built in.

The XOR method could be quite useful also, especially if the HMI does not have the toggle or alternate function
Attached Files
File Type: pdf flip.pdf (10.1 KB, 279 views)
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
flip flop logic Unregistered LIVE PLC Questions And Answers 20 February 6th, 2011 06:12 PM
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 or toggle: a rehash rsdoran LIVE PLC Questions And Answers 8 January 29th, 2003 02:58 PM


All times are GMT -5. The time now is 10:54 AM.


.