SLC 500 Allen Bradley/ RS Logix glitch

  • Thread starter ekumanufacturing
  • Start date
E

Thread Starter

ekumanufacturing

I am a college student, taking a class in PLC's. While just playing around making my own ladder logic programs, I tried some things that I know wouldnt work, and tried to download them onto our trainer. One thing that has baffled me, the graduate assistant, and the professor, is with the latch function. I programmed two different switches to turn on an out put, using the outputs twice, ofcourse that didnt work, so I tried using them latched, like O:0/0 and O:0/0(L) and it worked, but I didnt unlatch it. It isnt supposed to work, but it does, I was wondering if this just a problem in my trainers, or a glitch in the programming, of RSLogix.
Thanks
 
The output will be controlled with the last instance in the ladder, so if O:0/0 is after O:0/0(L) it will decide the output value putting zero or one in the output image table and if zero act the same as a unlath.
 
There's nothing wrong or unusual with your trainer units or your programming software.

Consider the execution sequence of Allen-Bradley controllers. A-B ladder logic solves left-to-right and top-to-bottom. Internal data tables are updated after the execution of each output instruction, but physical outputs aren't updated until the end of the program scan.

It's syntactically valid to use one output address in multiple output instructions; RSLogix 500 allows it, and the SLC operating system allows
it. It's considered poor practice, though, for reasons you have illustrated.

If you use two Output Enable (OTE) instructions with the same output address on two separate rungs, the last instruction executed will determine the state of the physical output. In between those rungs, though, you could examine the state of the output data bit and it would reflect the state solved by the first instruction.

If you used an OTE first and then an Output Latch Enable (OTL) instruction with the same output address, you'll find that the output will be true
while either of the input conditions is true. The OTL can turn the output ON, but cannot latch it because it may be commanded OFF by the OTE
instruction next scan.

If you used an OTL and then an OTE instruction with the same output address, you'll find that the OTL is trumped by the OTE.

There have been multiple threads, some of them quite convoluted, on the A-List about the "proper" way to use latch and unlatch instructions. I'd recommend a look through the excellent WWW.PLCS.NET, mantained by an A-List
regular.

Glad to hear you're learning on A-B demos, though !

Ken Roach
A-B Seattle
[email protected]
 
Hello,

Did your rungs look like this?

input1 Ouput1
-] [----------------------------------( )--

input2 Ouput1
-] [----------------------------------(L)--


Bradley G. Hite
Intertech Incorporated
mailto:[email protected]
http://www.myplc.comTeaching Practical Skills for a Technological World
 
T

Trevor Ousey

No this is not a glitch or error. If you had the latch before the OTE then it would perform differently. If you follow the logic, the first rung will turn on the bit O:0/0, and if the next rung with the latch has the input off, then it will not turn off O:0/0 as only an OTE or an OTU (unlatch) will in basic relay logic. Note that the I/O image table is updated after the program
scan has completed.

Cheers.
Trevor Ousey
 
M
You'll probably get lots of answers for this one.

Using an Output Energize instruction (OTE - looks like -( )- ), the ladder logic will put a 1 in the output address (O:0/0) when the rung is true, and a 0 in the address when the rung is false. The Output Latch instruction (OTL) will put a 1 in the output address (O:0/0) when the rung is true, and will do nothing if the wrong is false.

The I/O update (when the light is actually turned on or off) happens after the program scan. This is called a "synchronous" update, since the sequence is always program scan, I/O Update, program scan, I/O update, etc. During the I/O update, the PLC looks at whether there is a 1 or a 0 in the O:0/0 output address and either turns on or turns off the output. So in other words, your program is sticking 1's and 0's into the O:0/0 memory location, but the output isn't physically turned on until the I/O update. You can experiment with this by putting in a bunch of rungs that turn the O:0/0 address on or off and then put an unconditional OTL on the last rung. The output will not flicker, it will always be on.

If I understand your situation, the first output is an Output Engergize (OTE), and the second is an Output Latch (OTL). When the first rung is
true, and the second rung is false, the output will come on. When the first rung is false and the second rung is true, the output will come on (last rung wins). If both rungs are false, the output will stay off. When both rungs are true, the output will come on. When the first rung is true and the second rung is false, the output will come on (because the second rung is false, and the OTL instruction does nothing when the rung is false).

Sincerely,

Mark Wells
President
Runfactory Systems Inc.
http://www.runfactory.com1235 Bay Street, Suite 400
Toronto, Ontario, Canada M5R 3K4
Ph. 416-934-5038
Fax 416-352-5206
 
J

Johan Bengtsson

Well, as I read your description I think it is working as expected.

If you have an instruction to latch an output it sets a flag somewhere in the memory that this output (or memory) is supposed to be on if the condition before the latch instruction is true. The flag is not changed if the condition is false.
The unlatch instruction works in a similar way and clears that flag when the codition is true and does nothing if the condition is false.



/Johan Bengtsson

Do you need education in the area of automation?
----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------
 
A

Anthony Kerstens

The use of latches is a touchy subject. Some here use it frequently, and others such as myself avoid it unless absolutely necessary.

With SLC's, it is allowable to have multiple coils for the same address. The coil that is scanned last is the one that the I/O reflects. Each of the coil that are scanned earlier will change the state of the bit. If the bit is used between these multiple coils, the logic could be confusing to troubleshoot.

As a matter of good form, only have one coil per output. If using latch coils, try to keep the unlatch on the same rung, or at least close by.

Anthony Kerstens P.Eng.
 
J

Joe Jansen/ENGR/HQ/KEMET/US

Not a glitch:

the standard output --( )--, when off, will reset the latch on every scan. If the rung that contains the latching output --(L)-- is energized
it re-energizes the output during the scan. Since the I/O table is only updated between scans, there is no 'flicker' on the output.

since the --(L)-- instruction is only used to turn ON an output, and never turn it off, the first rung with the standard output will work normally if the -(L)- instruction is de-energized.

Note that if both outputs are energized, the output is actually staying latched, as opposed to unlatching and re-latching quickly inside the same
scan. No effective difference in the output, but can be seen as a difference inside the program. Try this:

--| switch 1|-----------( )-- O:0/0

----| O:0/0 |------------( )--- O:0/1

----| switch 2 |---------( L )--- O:0/0


Use output O:0/0 as an input in rung 2....

If either swich is on, output 0 will be on. however, if switch 1 is off, and switch 2 is on, output O:0/1 will be off, while O:0/0 will be steady state on at the output terminal. This proves that the standard output is re-setting the latch, while the --(L)-- is turning it back on, but nothing updates to the terminal except the very last state of the output bit.

Which is a long way of saying.......

"It's not a bug. It's a feature!"

This is actually useful in some of your more advanced programming solutions, and works exaclty as it should.

<GRIN>

Gee. And I only have a 2 yr degree in robotics. Go figure.

--Joe Jansen

www.plcarchive.com
 
B
This is normal. You can assign the same non-latched output to two different rungs and you may get a warning. It will run but the output will
not turn on unless the second rung is true. The first rung will turn it on and the second rung will turn it back off before the I/O update.

A rung with a latched output will not turn off the output if the rung is false. You must explicitly unlatch it. You can have many rungs with the same latched output. Any one of the rungs can turn on the output. This is occasionally useful, but this style of programming should generally be avoided, especially with output bits. If you must do this, use an internal but on many rungs and then use the internal bit to switch the output. Also
document why you are doing this.

Bill Sturm
 
B

Benoit Leclair

Hi i have a question related to the answer you gave to this guy, my question is :

if the OTE with the same name is programmed in an other ladder where the sub-routine dosen't go, is it right to say that the scan don't
care about all other bit in a sub-routine who is not call?

e.g. in lad #2 (main) =o:0/0 is on (ote), but in lad #5 the rung condition contain o:0/0 (ote)are off but the sub-routine is not call so at the end of the scan in the data table ,the output should be kept to ON

Do i'm right ???
thanks
 
J

Joe Jansen/ENGR/HQ/KEMET/US

You are correct. It will only change if the scan hits the rung containing the output. I use this in cases where I have several machines to upgrade software, but the hardware upgrades are slower coming. I write the program with both subroutines, and use a jumper wire to an input to select the proper subroutine. When the mechanics change the hardware, they also install the jumper, which selects the new subroutine. The old one is no longer scanned, and therefore the outputs are not affected by anything in that file.

--Joe Jansen
 
Top