unlatch command in allen bradley

be glad your not using Siemens

it is easy to see if a bit is true in AB .just open the variable table and look at it.

Now play around with a small program and a couple latch unlatch and then do the same with OTE and unlatch or reset.

Sequence of events will have a significant affect on your results.

And remember just cuz it is green doesn't mean it is on. This is one of the few little gotchas in AB ladder. Drove me nuts for a couple days.

Just look at the data table, you can even leave it open on the side while you play.

And no they are not a pair like a JMP LBL.

But if you have a latch you certainly need and unlatch some where.

The worst thing I have run into is following someone with a latch fetish.

Use them only when you have to, they are retentive.

Using more than one latch for the same bit is worse than using multiple OTEs for the same bit.

Nested latches in subroutines can cause headaches as well.

Just don't use latch unless there is no other way.

It's easy to just use the OTE bit to latch itself like you would with a real relay.

Then just break the latch with your reset bit.

Not sure why your example was written the way it was. Doesn't make sense from here................proximity answers allot of questions.
 
Greetings dahnuguy ...

now you’re probably already familiar with these ideas, but a lot of beginners read these forums and might possibly be misled by some of the wording in your previous post ... the following explanation is intended for them ...

regarding the statement:

it is easy to see if a bit is true in AB .just open the variable table and look at it.

in a basic “sun-is-shining, birds-are-singing, life-is-lovely” situation, the statement quoted above is usually “close enough for government work” as the saying goes ...

but ...

when things aren’t quite so rosy (as in a lot of “machine-is-down-and-we’re-trying-to-find-out-why” troubleshooting situations) the indications on the screen aren’t always so easy to interpret as many people seem to think ...

case in point:

in the first figure shown in this post the “green” and “not green” indications on the ladder display can NOT be fully trusted ... the same degree of mistrust should also be applied to the ONE and ZERO indications on the data tables ... specifically, the data which feeds the “green” screen indications is EXACTLY the same data which shows up on the data tables ... more specifically, you can’t get a “more up-to-date look” at the bit status by going “straight” to the data tables than by just reading the “green” highlights on the ladder display ... in other words, ALL of that data has to come through SOME type of communication link (a cable) - and therefore NONE of it can be counted on to be precisely “real-time” as the processor executes the ladder logic program ...

the second figure in the same thread (as linked above) demonstrates one handy technique which can accurately show the ONE or ZERO status of a particular bit ANYWHERE during the program scan ... now usually you don’t need to dig this deep - but when the chips are down and the indications on the screen don’t really seem to make sense, this is a handy way to see what’s really going on ...

party on ...
 
Last edited:
hey Ron...this also is for the those who may find it useful.

Well let me start by saying I agree with you............I have found that is a good way to start off and prevent missunderstanding.


To begin......

ALL of my previous (92 to 05) experience with PLCs was the "machine down whats goin on type" and it has been several years since I used SLC500s or any AB.

I used to employ a bit trap method which is probably very similar to what I have read you reference. Along with a few AFIs and well placed force bits. I even added diagnostic areas to count this and that etc etc......you have heard it all before but it works and clears up the mystery.

The multi coil out and the latch coil are by far the trickiest things to deal with and I curse the people who use them as if they are the greatest thing ever. I have spent days re-writting multi coil ladder to use only one coil assignment and gee what do you know the weird stuff stopped.

Another tricky bit is downloading while the machine is running..............yes the data are changing as you wait for the download.....no it isn't instantaneous..........so many just dont get that one.

I used to enjoy using the test mode with the nice undo function of SLC500.

I couldn't stop the machine , it was the whole building , one huge bunch of I/O in one long serial process. So it was tricky.

I have enjoyed reading many of your bits.

What I meant by looking at the data table is that one can easily see the data of many ins and outs in one place.

The green true part is just confusing on the latch and unlatch coils..................just have to accept that. The right click "find all" is a handy function here.

It is also possible to make a custom data table with just the bits you want to watch when everything will not fit on the same page. (on the left near the variable tables)

And believe me when I say if you think AB is rough don't get anywhere near Siemens................trust me. It's like RSLogix on a bad day with the wrong drivers and an intermitten cable times 1000.

The whole output table updated at the end of the scan really trips up allot of people and some tricky folks use this detail as a feature in the ladder to make their programs work a certain way.

Once the new programmer / troubleshooter understands this , it all gets much easier.

I never did like the unlatch being green when the latch was true............always struck me as a defect.

I also would find these tricky places in the code and rewrite them until they worked AND were easy to follow when troubleshooting. The next guy had it so much easier than I did.

Except for the expense, I would recommend AB to anyone.
 
To expand on Alaric's reply:

OTE - IF condition is TRUE THEN output equals TRUE ELSE output equals FALSE

OTL - IF condition is TRUE THEN output equals TRUE


OTE - IF condition is TRUE THEN output equals FALSE


I would add to the second one that

OTL-IF condition equals TRUE for one scan or more, THEN output equals TRUE ......until another instruction turns it off by writting a zero into the memory bit.

And of course I assume your last was just a mistype of OTU.
 
I have seen situations where a OTU is not needed in conjunction with a OTL. Clearing the Data tables to zero could be done by the Move, FLL, or Copy commands as well. Had a instructor inform me that you can't have OTL without a OTU. Not the case.
 
Greetings dahnuguy ...

thanks for not misunderstanding my purpose in writing ... nice to know that we’re on the same page ...

and while we’re on the subject of monitoring the status of the PLC’s bit tables, here’s a little trick that some of our beginner readers might not know about ... if you click the little icon in the upper left corner of the table, you get an “On Top” selection on the popup menu ... turn that on and the table won’t play hide-and-seek when you click on other windows on your display ...

so ... where in South Carolina are you? ... if you’re ever down Charleston way, stop by the lab and we’ll shoot the breeze ...

on_top.JPG
 
the hairs,they must be split

au contraire.

All that is required is to execute a false OTE - or, as already stated, clear the bit with some type of file instruction.


"You need AN unlatch somewhere"

True.

And a false OTE will not unlatch a latched bit in my experience..........this is from memory of course as I do not have the pleasure of using AB anymore. That's the whole point of the latch. Turn on once stays on until reset. allot of this stuff I eliminate with my direct and basic style. I enjoy stability and solid performance and find beauty in simplicity. Besides having a OTL and an OTE violates my rule of no multiple coils............so I would not do it nor would I recommend it. You will notice one of the AB softwares even warns you if you have multiple coils but it allows the compile and download if you say you are sure. I think it was SLC500 but it might have been AB5.

Off is not the same as Not ON. Thats why I had to use 4 confirmation switches on every valve in the checmical plant. N.O. and N.C. for open and closed, using both sets of contacts in 4 different switches. This of course was just for the 20 or so really nasty chemicals kept in bulk all over the place.

Just because you have a false OTE does not mean the output is OFF nor does it mean that the field device is de-energized or in the "other" state.
Ron has spent a great deal of time detailing this far better than I ever explained it.

Writing a zero to the memory location IS "an unlatching method"........you do not necessarily need an OTU true, but you must use some form of reseting or unlatching after the output is latched. The method you use is up to you.
 
Last edited:
Ron,

I have read enough of your posts to see that you are genuinely interested in getting at the truth of the matter and I have not seen anything you have written that would lead me to believe you are here for anything other than to help others, keep your own troubleshooting skills sharp, stay in touch with whats going on "on the ground" and maybe to promote your bussiness a little. (not like you didn't see that , right?)

All very reasonable and well done.

So if I ever did read you the wrong way , I would ask and give you the benefit of the doubt before assuming some other motivation.

I try to stay open and keep my cup as empty as possible. After all, what I might think I know , even it all is absolutely correct, is but a grain of sand compared to what there is to know.

I am in York SC.

If ever get close to Charlston I will certainly stop by. I taught a few classes at YorkTech in York SC on the non acredited side "furthering education" and did some classes at the customer site and some on campus. From electrical safety to basic circuits and electricity to motor controls and then PLCs. I think teaching is fun. Unless I find some non boring work in the near future I would rather teach. Right now I am challenged by Simens Step7............

You ever use S7?


While looking over your site I was struck by your offer to verterans. More companies should have this outlook. Not a handout or charity but a chance. I would even expect that any who take the offer would at least try to pay back some if they were able and would probably be great for PR.
 
Last edited:
Greetings dahnuguy ...

Ron, I have read enough of your posts to see that you are genuinely interested in getting at the truth of the matter and I have not seen anything you have written that would lead me to believe you are here for anything other than to help others, keep your own troubleshooting skills sharp, stay in touch with what’s going on "on the ground" and maybe to promote your business a little.

actually the “business promotion” angle (believe it or not) is not really part of the master plan ... I make no secret about what I do for a living, but over the years I’ve gotten less than a handful of paying customers from my exposure on the forums ... most of my work comes from marketing directly to larger industrial plants - not from individuals reading the forums and trying to learn PLCs on their own ... my prices are rather “steep” for an individual to pay out of his household budget - but still quite in line with what an employer should be willing to invest in getting his employees trained up to an effective level ...

anyway ... I joined the forums several years ago when I was working for an Allen-Bradley distributor - as inside technical support ... the forums quickly became one of my favorite “spare time” hobbies ... now that I’m self-employed, I still keep up with a couple of forums - mainly because I enjoy it ... (realizing that it could become somewhat “addictive” is one major reason why I refuse to have an internet connection at home) ...

So if I ever did read you the wrong way, I would ask and give you the benefit of the doubt before assuming some other motivation.

I appreciate that ... I usually spend a LOT of time writing - and then rewriting my comments before I actually post them ... it’s incredibly easy to be misunderstood by what we write in a forum like this ... where “tone of voice” helps in a face-to-face situation, the words we type can often give the wrong impressions of what we meant to say - and how we meant it to be taken ...

I think teaching is fun.

fun, yes ... absolutely ... and rewarding ... it’s also the most mentally demanding job that I’ve ever had ... the hardest part for me is showing “experienced” technicians that a LOT of what they “know” about the subject matter is actually wrong - and misleading ... well, actually the “showing” part is quite easy - a demonstration with a spare PLC and a few switches and lamps can take care of that ... but the trick is to do it “gently” - but “firmly” ... convincing someone that they’ve had misconceptions about something for many years - without appearing to be insulting or demeaning - can be extremely challenging ... especially in a more-or-less public classroom with other students listening in ... the best approach I’ve found is to make the class something like a game - with each student competing in a FRIENDLY manner against the others - and against the instructor (me) ... I’ve been told many times by neighbors in other offices down the hall that my classes sound more like a super bowl party than technical training ... the “fun” that you mentioned is definitely a big part of that ...

Right now I am challenged by Siemens Step7. You ever use S7?

nope ... zero experience on that one ... someone asked me the other day why all I teach is Allen-Bradley ... the honest answer is that AB is the only brand that I’ve ever been asked to do ... if a sizeable market happened to materialize for Siemens, then I’d go straight to my chief financial advisor (wife Wanda Faye) and try to coax enough money out of the bankroll to set up a new course ...

I tend to think of myself as sort of “semi-retired” these days ... Wanda Faye and my accountant are constantly reminding me that it’s OK to have fun, but I’m still expected to bring in an income ...

While looking over your site I was struck by your offer to veterans. More companies should have this outlook. Not a handout or charity but a chance.

I remember several years ago (back when we still had a TV set) listening to a newscaster make the following observation:

suppose that you take a helicopter ride over the scene of a disaster ... say a terrorist attack - a fire - an earthquake - a battle ... once you get up high enough, the people all begin to look like little ants - all of them running away - in a rapidly spreading circle - with the center of the circle located at the site of the disaster ...

but if you look closer, you’ll see that there are a few - just a few - of the ants who are actually running directly TOWARD the center of the disaster ... those are what we call “heroes” ... you can actually watch them fighting their way upstream against the flow of humanity - willingly putting themselves in danger - risking their own lives to save and protect the other ants who might not otherwise get away safely ...

now it might sound “corny” to some people - but “duty” is a big word in my book - and personally I hold an immense respect for the “heroes” around us that are willing to serve ... so far I’ve only had one veteran who’s been able to take me up on my offer - but hopefully (prayerfully) the world situation will change enough to allow others to come in the near future ... I would consider it an honor to have them attend - with no expectation of any “payment” beyond what they’ve already given ... when you get right down to it, providing a week of PLC training in an air-conditioned classroom isn’t much at all in comparison ...

well, things are slow right now ... it’s the end of an old year - with a new one coming up in just a day or so ... thanks for the conversation ... stop by the next time you’re down this way ...
 
Last edited:
YES if..

Are you trying to say....


Code:
  n7:0/1     b3/1
---|  |------(   )--
          |
          |  n7:0/1
          |--( U )--


If so, this is very common when an hmi is writing to n7:0/1.


better usually, to do this though...


Code:
  n7:0/1            b3/1
---|  |-----[osr] -(   )--
          |
          |        n7:0/1
          |--------( U )--

plus with that green thing that someone mentioned....

right click and select "go to data table" if you are indeed using AB
 
Last edited:
YES if..

Are you trying to say....


Code:
  n7:0/1     b3/1
---|  |------(   )--
          |
          |  n7:0/1
          |--( U )--


If so, this is very common when an hmi is writing to n7:0/1.


better usually, to do this though...


Code:
  n7:0/1            b3/1
---|  |-----[osr] -(   )--
          |
          |        n7:0/1
          |--------( U )--

plus with that green thing that someone mentioned....

right click and select "go to data table" if you are indeed using AB

yes these are nice examples using the unlatch.

you could also move a "0" into n7:0/1 which is part of our discussion.......alternative ways of unlatching

................I just love seeing AB memory locations...........That N7 is an integer and it is located at the 8th interger.........and you can select it from the data table, see what data is in it and even use copy and paste or even drag it into the program page and drop it..............brings back such nice memories.

So simple so easy so solid..............so not Siemens.

and I miss the OSR too. Siemens has a POS which goes true on the positive edge but it stays true ...........they may have a true one shot rising , but I haven't found it yet.
 
someone on this forum about 6 years ago, displayed a way to do this logic on the word level by using an XOR instruction.

It was a clever way to oneshot many hmi buttons.
 
Code:
  n7:0/1     b3/1
---|  |------(   )--
          |
          |  n7:0/1
          |--( U )--
better usually, to do this though...

Code:
  n7:0/1            b3/1
---|  |-----[osr] -(   )--
          |
          |        n7:0/1
          |--------( U )--
The osr adds nothing to this logic. Without the osr, n7:0/1 will only be true for one scan since it is being unlatched here when true and, therefore, b3/1 will only be true for one scan.


This is what we use a lot:
Code:
  start       stop         run
  n7:0/1     n7:0/0        b3/1
---| |---|-----|/|---------( )--
         |
   run   |
   b3/1  |
---| |---|
                          stop
                         n7:0/0
------------------------|--(U)--
                        |
                        | start
                        | n7:0/1
                        |--(U)--
 

Similar Topics

Hello All, Can someone see what I did wrong here. My "PA" bit never seems to get energized despite hitting "SOFTKEY7" many times
Replies
5
Views
706
Hi guys, I have a question regarding studio 5000 with processor 1769-L33ER V33.011 and Factorytalk View SE V12. I have an home-made pop-up...
Replies
3
Views
1,534
I'm troubleshooting a machine for a customer right now, and the output that is not working needs this bit to go high to activate the coil. But the...
Replies
36
Views
13,539
I am trying to convert an old PLC5 program. I have several instances in the unlatch instruction where they give a B file on top of the unlatch...
Replies
9
Views
1,998
Hi everyone. First time poster here. I am very new to PLC programming (my programming background is more in computers). I have a question with...
Replies
12
Views
3,186
Back
Top Bottom