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 October 29th, 2004, 07:08 PM   #1
BOWRIDER
Member
United States

BOWRIDER is offline
 
BOWRIDER's Avatar
 
Join Date: Mar 2003
Location: FLORIDA
Posts: 58
To Latch Or Not To Latch

Hello again fellas! I have a little question/observation. I am fairly new to the wonders of plc programming. I probably started self study at work and at home about two years ago almost exclusively on AB rslogix and feel that I have become fairly proficient at discrete type programming. I have yet to venture into analog or pid stuff yet but I will save that for another time.
What I have noticed during my studies is for reasons unknown to myself until just recently, is I have always favored latching outputs, bits etc using a branch as opposed to the OTL and OTU instructions. Recently while troubleshooting a program at work that had many otl and otu instructions I think it has dawned on me as to why they were never popular with me. The reason is troubleshooting. My feeble mind finds it very distracting to have to jump back and forth in the program finding all the latches and unlatches for a particular output.
Now for my questions.... Which method do you seasoned guys prefer? and also do other manufactures programming software contain their own versions of the OTL and OTU instructions? I can't stay here tonight but I look forward to reading your replies Tomorrow.
good night gentlemen! And happy Halloween!
  Reply With Quote
Old October 29th, 2004, 07:33 PM   #2
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
I don't have a problem with either method. Each has their pluses and minuses.

If your code is really modular then handling latch/unlatch is pretty straight forward and really easy to troubleshoot.

As in the case for any PLC programming, careful planning (organization) rules the day.

There will be plenty of others that say NO! NO! NEVER USE LATCH/UNLATCH!

Those are guys that have been burned by their own inadequate planning.

Latch & Unlatch are reasonable tools to use... otherwise... why do they exist?

It boils down to careful usage and organization... just like anything else in programming.
  Reply With Quote
Old October 29th, 2004, 07:37 PM   #3
Rube
Member
United States

Rube is offline
 
Rube's Avatar
 
Join Date: Sep 2003
Location: Fort Worth, Texas
Posts: 932
YOU'RE NOT DOING IT RIGHT!

And you're not doing it wrong, either. The use of latches is, in a lot of cases, the preference of the programmer. Now, there are times when one is more sensible than the other, and some instances where one is necessary. But the beauty of programming is you can basically program in a signature style all your own. As you program more you'll start to notice where the differences I mentioned above come into play.
__________________
Mark A. Crowley

Automation is not a corrective action for a lack of discipline.
  Reply With Quote
Old October 29th, 2004, 07:52 PM   #4
Thomas Sullens
Member
United States

Thomas Sullens is offline
 
Join Date: Feb 2004
Location: Idabel, Ok
Posts: 390
To Latch Or Not To Latch

I vote to latch, it always starts out simple and ends up complicated anyway. banghead zzzzz
  Reply With Quote
Old October 29th, 2004, 07:59 PM   #5
Eric Nelson
Lifetime Supporting Member + Moderator
United States

Eric Nelson is offline
 
Eric Nelson's Avatar
 
Join Date: Apr 2002
Location: Randolph, NJ
Posts: 4,346
I use both methods. As Terry stated, each one has their advantages/disadvantages.

When I use latch and unlatch, I try to keep them on adjacent rungs, so you don't run into the troubleshooting headaches that you mention.

beerchug

-Eric
  Reply With Quote
Old October 29th, 2004, 08:00 PM   #6
CaseyK
Member
United States

CaseyK is offline
 
CaseyK's Avatar
 
Join Date: Feb 2004
Location: In the cornfields, on the prarie, outside Chi-Town, a few miles beyond the boondocks.
Posts: 1,731
Lightbulb

Now that I've had time to think about it, I don't thinks I likes latch and unlatch.

I think if I need a latch, I will just use a holding contact like in the relay logic days.

But then, I still think relays have a future.

regards.....casey
  Reply With Quote
Old October 29th, 2004, 08:54 PM   #7
GregPLC
Member
United States

GregPLC is offline
 
GregPLC's Avatar
 
Join Date: Oct 2002
Location: Milwaukee, WI
Posts: 342
Eric hit it right on the head....the key to OTL and OTU are keeping them in the same proximity in the code for a given coil, preferrably in adjacent rungs...some people claim OTL and OTU is a little more spaghetti like, but I disagree....I use them when I can, don't be afraid to if you have well thought out code.


Greg
__________________
  Reply With Quote
Old October 29th, 2004, 08:57 PM   #8
Rick Densing
Member
United States

Rick Densing is offline
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 1,538
Quote:
Originally posted by Eric Nelson
When I use latch and unlatch, I try to keep them on adjacent rungs, so you don't run into the troubleshooting headaches that you mention.
I agree. I try to only use latches when I want info to be retained through power cycles.

Though in RSlogix, the right-click find all button reduces the headache significantly.

(Not a RSL pom pom, its just that I do most of my programming with it and haven't used much else lately)
  Reply With Quote
Old October 29th, 2004, 09:36 PM   #9
CaseyK
Member
United States

CaseyK is offline
 
CaseyK's Avatar
 
Join Date: Feb 2004
Location: In the cornfields, on the prarie, outside Chi-Town, a few miles beyond the boondocks.
Posts: 1,731
Lightbulb

When I use them (seldom), I like them on adjacent rungs.

I think some guys will keep then distant just to confuse people or for job security.

regards.....casey
  Reply With Quote
Old October 30th, 2004, 06:48 AM   #10
Ken Moore
Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: Upstate South Carolina
Posts: 2,325
I'm pretty much like everyone else, I use both; and I keep the latch/unlatches together. The latch & unlatch command is really a set and clear function. Many other programming interfaces have these commands, I know Tisoft does, and Foxboro DCS has the set/clear function also.

Ken
__________________
"To give real service you must add something that cannot be bought or measured with money; and that is sincerity and integrity."
- Donald A. Adams

  Reply With Quote
Old October 30th, 2004, 07:10 AM   #11
ArikBY
Member
Israel

ArikBY is offline
 
ArikBY's Avatar
 
Join Date: Oct 2003
Location: Oranit Israel
Posts: 1,434
I use latch&Unlatch with AB because that the only option AB offer for retentive relaye when the power is go off&on.
I dont like to use latch&Unlatch even it "make sense"
You need to write your code in a way you can easily see when you latch certain bit and where you unlatch.
You also need to unlatch all when the power go on or under certain conditions.
__________________
Arik

Barak Control Israel
  Reply With Quote
Old October 30th, 2004, 09:27 AM   #12
jimbo3123
Member
United States

jimbo3123 is offline
 
Join Date: Sep 2003
Location: Detroit Area
Posts: 550
I typically use latches on occasion, but I try to avoid over-using them.

Some of my customers specify that latches are forbidden in their code (I believe it's in a DaimlerChrysler spec. somewhere). I suspect that they do that for troubleshooting/readability reasons.
  Reply With Quote
Old October 30th, 2004, 09:50 AM   #13
elevmike
Member
United States

elevmike is offline
 
elevmike's Avatar
 
Join Date: Feb 2004
Location: Detroit, MI
Posts: 4,012
Quote:
Originally posted by jimbo3123
Some of my customers specify that latches are forbidden in their code (I believe it's in a DaimlerChrysler spec. somewhere).
Never saw that myself... Hope they dont look to deep...
  Reply With Quote
Old October 30th, 2004, 10:56 AM   #14
Tom Jenkins
Lifetime Supporting Member
United States

Tom Jenkins is offline
 
Tom Jenkins's Avatar
 
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 5,813
I avoid latching and unlatching coils, and resetting bits through other kinds of manipulation. That is for the very reason you identify - troubleshooting is simplified. A holding contact is much more obvious, and you can more easily keep track of what is going on and why things are behaving the way they are.

I do occassionally use them, but only when it represents a significant advantage in the logic (which is seldom) and then I comment the heck out of the code and try to keep them in close proximity in the code.
  Reply With Quote
Old October 30th, 2004, 01:20 PM   #15
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 5,335
but don’t forget the SAFETY issue ...

Greetings to all,

besides all of the other aspects of “to latch or not to latch” being discussed here, one EXTREMELY important characteristic of latches which has not been specifically mentioned is the “retentive” nature of these beasts ...

these guys did mention something about the subject in passing ...

from Rube in post #3:

Quote:
The use of latches is, in a lot of cases, the preference of the programmer. Now, there are times when one is more sensible than the other, and some instances where one is necessary.
from Rick Densing in post #8:

Quote:
I try to only use latches when I want info to be retained through power cycles.
from ArikBY in post #11:

Quote:
I use latch&Unlatch with AB because that the only option AB offer for retentive relaye when the power is go off&on. ... You also need to unlatch all when the power go on or under certain conditions.
let’s take a look at this in more detail ...

suppose that programmer Sam likes the “seal-in” type of construction ... and Sam has programmed the saw in the figure below ...

suppose that programmer Greg likes the “latch/unlatch” type of construction as his personal favorite ... and Greg has programmed the grinder in the figure below ...

[attachment]

and both machines having been working fine for a very long time now ... the start buttons start ... the stop buttons stop ... the boss is making money ... what more could we ask for? ...

now suppose that while the saw and the grinder are both happily running along, the electrical power to the building suddenly dies ... naturally all of the machinery comes to a halt ... the question is, folks: “what is going to happen when the power eventually comes back on?” ...

well, the saw motor will NOT start back up automatically ... BUT (and here’s the punch-line) ... the grinder motor WILL start back up just as soon as the power comes back on ... and that could be a BIG safety issue ...

now ... I know that I’m going to get a bunch of posts saying stuff like: “well you should have OTHER things (mechanical interlocks, etc., etc., etc.) to prevent the grinder from coming back on” ... I’m not going to debate all of that ... the major point here, folks, is that there are some BIG differences between the way “seal-in” constructions and “latch/unlatch” constructions behave ... the example above is meant to demonstrate that concept in an easy-to-visualize way ...

the book says that the latches are “retentive” but doesn’t do much in the way of explaining (from a safety standpoint) just what the term “retentive” means ... basically it means that you can write a program using latches and unlatches which will perform flawlessly in the shop ... and work perfectly when you commission the machine ... and function faultlessly when the customer accepts the machine and puts it into use ... BUT ... if you haven’t adequately considered the “retentive” nature of the latch/unlatch construction, then you could conceivably have a ticking time-bomb on your hands ...

now I know that some people don’t like latches ... and some even flatly refuse to use them at all ... but now let’s go one step further and think about this next angle ...

suppose that we use a Recirculation Pump for our next example ... suppose that this particular recirculation pump is necessary to keep our nuclear reactor cool ... now if we were to unwisely use the “seal-in” approach to program its control, then every time the electrical power flickered, someone would need to go over and press the start button to bring the pump back on again ... so this would be a natural place to use a “latch/unlatch” construction ... because the latches are “retentive” ... they “retain” their ON status when the processor is power-cycled ... so a latched-on construction would definitely be a better (SAFER) way to program our recirculation pump ...

and please, folks, don’t jump on my case about how to REALLY control a nuclear power plant ... we all know that I’m just trying to come up with some interesting examples to illustrate these programming concepts ...

next ... a basically true story ... suppose that a customer has programmed his lumber mill using seal-in rungs to help the processor “remember” where the logs are located ... so when a log moves past Limit Switch A, he seals-in bit B3/22 ... this means there is a log in position A ... when the log moves past Limit Switch B, he unseals bit B3/22 ... this means that Position A is empty and ready for the hydraulic ram to feed in another log ... now suppose that the ram has just shoved a log into Position A ... so bit B3/22 is set (1) ... but then the power to the plant flickers ... what happens to B3/22? ... since he’s using a seal-in rung construction, B3/22 gets reset (0) ... oops! ... the PLC thinks that Position A is empty ... the hydraulic ram shoves in an extra log and does about $4,000 damage to the saw ...

this would have been a good place to have used a “latched-on” type rung construction ...

and so in summation ... in addition to all of the perfectly valid “keep the controls together” and “latches and unlatches are neater than seal-ins” and “seal-ins are easier to troubleshoot” arguments, there ARE some important SAFETY issues to consider when deciding whether “to latch or not to latch” ...

finally ... for those who want to dig even deeper into this subject, much of what I’ve included here (and much more) can be found in this previous thread about “pre-scan” ... for inquiring minds, it might make for some interesting reading ...
Attached Images
File Type: jpg retain.jpg (81.4 KB, 1253 views)
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.


Last edited by Ron Beaufort; October 30th, 2004 at 01:52 PM.
  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
slc500/4 help with latch Peternjs LIVE PLC Questions And Answers 1 March 1st, 2004 05:04 AM
Latch a Bit then Bit Shift Left jthornton LIVE PLC Questions And Answers 2 August 22nd, 2003 06:35 AM
memory latch with a timer redmanrh LIVE PLC Questions And Answers 17 August 10th, 2003 02:48 PM
Keeping track of bottles to be ejected Dartrunner LIVE PLC Questions And Answers 27 August 4th, 2003 11:58 AM
RS Flip Flop suranjan LIVE PLC Questions And Answers 7 January 18th, 2003 09:56 PM


All times are GMT -5. The time now is 04:55 PM.


.