help debugging Micrologix program

RH68

Member
Join Date
Jun 2008
Location
Maryland
Posts
21
Hi,
I am trying to get the control program for a machine I'm working on debugged. There is one problem I can not seem to solve.
The machine works as follows: a pair of three position cylinders raise a rotating carriage up and down. The carriage has grippers on it that grab containers when in the top position, and release them in the bottom position. The machine waits at an intermediate position until a signal is received that indicates it is ok to release the containers. Until this signal is received, the carriage waits 2" about the bottom position (this is why I am using the 3 position cylinders. Once received, the carriage drops the last 2", releases the containers, and raises back to the top position to reload.
The problem I can not resolve is as follows: I have a pushbutton that allows the operator to momentarily open the gripper fingers when in manual mode. When in auto mode, the fingers open automatically. Opening them using the PB is used to align the containers when starting the machine. I added a line of logic called "finger open override stage" to allow the operator to do this. This works. However, the fingers don't operate properly in the rest of the program. The output that opens them is latched on in rung 3 (O:0/8)and unlatched in rung 9. This output should remain on until the carriage has lowered to the bottom position and dispensed the containers. What is occurring is that the gripper fingers open and then immediately close again. The program is attached. Any help would be greatly appreciated.
Thanks! RH68
 
Check rung two, you have an OTE instruction using that address. ( double coil) not good practice. I'm not sure that's it but should be look at.
 
I am certainly not an expert, but I would agree with Mickey on both statements.

I personnaly do not like using OTLs that often. An OTL retains it's current state until it is unlatched by the program. I believe this is true even in a power loss situation. (Please correct me if I am wrong).

So what happens if someone hits an E-stop, power drops out, loss of air pressure, ect.? The program only knows it is told to do. If power returns, E-stop gets reset, the PLC will try to go on doing what is was trying to do. Is this what you wish to happen? Is that a safe thing to happen?

This may not be relevant to your situation, but I like to let the PLC know what's happening so it knows what to do in those situations.
 
The PLC doesn't hold its latches through poweroff if that's what you mean


I cannot say you are wrong, but here is a quote from the SLC Instruction set Help, under OTL.

"Warning! If an error condition occurs that halts processing, the physical output will be turned off. But once the error condition is cleared the controller will resume operation with the OTL in the state determined by its data table value.

Note In the event of a power loss, any OTL controlled output device will energize with the return of power if the OTL bit was set when power was lost.
Rockwell Software 2005"

:confused:
 
I see what you mean, but what I ment to write was that the coil isn't energized through a power off.
 
I would seriously look at a re-write of your logic. Using OTLs on physical output addresses is not desireable and as mentioned could lead to a host of issues on an uncontrolled restart. You understand that an OTL is not a 'latch' correct (I much prefer TIs nomenclature of SET and RESET)? All an OTL does is write a '1' to the bit location in question. Once that occurs, that '1' will stay there regardless of power down, program mode, etc. until another instruction explicitely writes a '0' into that location (whether an OTU, OTE or a word move of 0).

You've started out well by using a psuedo sequence to mimic your process. I would however modify that to include an idle state B3:0/0 on for example. Then, progress as you have done: If XIC B3:0/0 and XIC start conditions, OTL B3:0/1 and OTU B3:0/0. Next step would be XIC B3:0/1 and conditions, OTL B3:0/2 and OTU B3:0/1 and so on.

Then, use the above steps to actuate your outputs:

XIC B3:0/1 OTE Output
XIC B3:0/1 OR B3:0/2 OTE Output (Keeping an output on through steps)

On Powerup, program to run, do as you have done, but instead of clearing all B's, set the first step true (B3:0/0).

What you are creating is a step routine (commonly known as Grafcet) and is a very stable and powerful way to program.

Good Luck
 
Last edited:
I see what you mean, but what I ment to write was that the coil isn't energized through a power off.

What coil? The physical output (which may be a solenoid, relay, motor starter) loses power when the processor is turned off, but will regain power as soon as the processor is turned back on, as the internal bit will still be set, unless explicitely turned off by an instruction. That's why I hate the term 'latch' for an OTL instruction as it is most definitely a misnomer.
 
What coil? The physical output (which may be a solenoid, relay, motor starter) loses power when the processor is turned off, but will regain power as soon as the processor is turned back on, as the internal bit will still be set, unless explicitely turned off by an instruction. That's why I hate the term 'latch' for an OTL instruction as it is most definitely a misnomer.

I do not wish to correct you, but it is quite common to refer to the internal bits as "coils". Yes, it's actually a bit, but it is often referred to as a virtual coil. Just a matter of preference I suppose. I personnally refer to it as a bit, but I knew precisely what he was saying.

Although, I disagree that an OTL is not a latch. Granted, it is not a physical "latching" relay.
But then (XIC -| |-) does not actually represent a closed contact either. Electrically that is a N.O. contact.

For my own curiosity, could you detail what you consider a latch to be?:unsure:

I know, this could balloon into quite a discussion on ladder logic symbols, but why not?, it's saturday!
 
Last edited:
I do not wish to correct you, but it is quite common to refer to the internal bits as "coils". Yes, it's actually a bit, but it is often referred to as a virtual coil. Just a matter of preference I suppose. I personnally refer to it as a bit, but I knew precisely what he was saying.

Not correcting me....I agree that coil is commonly used to refer to an internal bit, however, from the previous poster's statement, I couldn't ascertain whether he was referring to the internal bit, the external output or the device connected to the output. That's why I asked 'what coil?'

Although, I disagree that an OTL is not a latch. Granted, it is not a physical "latching" relay.

Then explain how it is a latch? A latch implies that something holds in a circuit. A sealing circuit. How is setting a bit and nothing holds that bit true afterwards considered a latch?

But then (XIC -| |-) does not actually represent a closed contact either. Electrically that is a N.O. contact.

XIC has nothing to do with Normally Open. That's a fallacy and a dangerous comparison. I can have a Normally open device or normally closed device, but I cannot have a normally open Input or Normally closed input. The input evaluates to TRUE (1) when there is current flow or voltage present. The XIC instruction is simply evaluating whether that bit that is associated with the physical input is on or off. Nothing more. I often see electricians calling an XIC a normally open contact in the PLC and that leads to MUCH confusion.

For my own curiosity, could you detail what you consider a latch to be?:unsure:

See above

I know, this could balloon into quite a discussion on ladder logic symbols, but why not?, it's saturday!

Wait'll Ron get's ahold of you ;)
 
Last edited:
What is a latch?
I would consider a latch to be a componet, or, even a circuit, with 2 stable states. Like a flip-flop, or even a light switch. It maintains either state until it is told to change that state. Simply removing power should not change the state. A sealing circuit is not really a latch, although I myself will often refer to it as a latching circuit. I have seen flip-flops that will change when power is dropped, I have seen them that will not, so let's not go into that. OK?

What Coil? I saw what was being referred to, you did not. I assumed you may not have heard it referred to in that way. My bad as they say.;)

-| |-. I am perfectly aware of what it indicates. I am very well versed in boolean logic. I have read, and been told by an instructor,(whom I was not impressed with), that ladder logic was concieved to be simple enough so that you do not need a programming degree to understand it. That is why the XIC, and XIO symbols were used.

I do not think referring to the XIC as Normally Open, is what is confusing, I think that using these symbols to indicate on, or off is what creates the confusion. It's not like it's hard to grasp, just too close to the electrical world. If it were me, I would use standard boolean logic. If B3:0/0 then , If !B3:0/0 then, ect .
But hey, that's just me.

Does Ron not like these discussions? I don't know him, no biggie.

This just being text, it's hard to tell, but I hope I am not detecting aggravation in your post. that is certainly not my intention. Just a silly little BS and thought exchange was all that I intended.

Have a good weekend! 🍻
 
Last edited:
No, no....not aggravated at all. My comment about Ron is that he LOVES these discussions and has contributed to them at length over the years.

I definitely think referring to XICs as Normally Open is a huge no-no, but that's just me. In my experience through industry, systems integration and training (not tooting, just saying I've been exposed to various levels of people), it's one of the harder concepts to grasp for the electrician/technician that has cut his teeth on hardwired relay circuits. I cringe (again, just me) when I hear XICs equated to Normally Open contacts.

Lastly, I'm not sure that a light switch compares favorably to an OTL. An OTL's logic can go false and the bit is still set. You turn the state of a light switch to false and it goes off. A light switch operates like an OTE. Maybe I'm missing the point? (not the first time :)) I would compare an OTL to an old X-10 style button. You turn it on and it sets a command and doesn't do anything again until it receives a second command. I don't call that a latch. I call it set and forget.
 
Thanks for the help so far everyone. So the recommendation seems to be that I should not latch the output coils. In this case, should I have a separate rung for each output coil, and use XIC in parallel for the bits that turn on each output? That way, if I needed to turn on an output in different stages of the program, I could do it that way? For example, the "fingers open" output needs to be held on thru a few stages, so should I just put XIC contacts in parallel for the bits for each stage the output needs to stay on for? This would also seem to solve the issue of having a coil for the same output used multiple times in the program.
Thanks!
 
What coil? The physical output (which may be a solenoid, relay, motor starter) loses power when the processor is turned off, but will regain power as soon as the processor is turned back on, as the internal bit will still be set, unless explicitely turned off by an instruction. That's why I hate the term 'latch' for an OTL instruction as it is most definitely a misnomer.

Tomato Potato.........
 

Similar Topics

I have a mTV100 project connected to a CompactLogix processor via Etherenet. After some recent mods I'm getting a continual "PLC Comms Error"...
Replies
5
Views
2,822
Hello all, Can someone please look at the attached program to give me some help figuring out why one of my counts (the 'actual' count triggered...
Replies
6
Views
2,164
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
220
Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
185
Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
191
Back
Top Bottom