one input precedence over another

realolman

Member
Join Date
Mar 2009
Location
here
Posts
584
This seems like it should be simple day one programming, but it has been kicking my butt.

COntrolLogix5000

two inputs ... How can I program the ladder logic so that one input takes precedence over another if they go true at the same time, and prevent the other from having any effect until I allow it.

thank you
 
Put the "Takes Precedence" input FIRST in your ladder logic. Use it to lock out the other input with a latched or sealed-in bit. Remember that a PLC scans in a certain order, normally top-to-bottom left-to-right. The first one wins.

Oh I forgot: ControlLogix has an assynchronous scan. If you are use that mode to scan your inputs immdediately when they go ON, you might be screwed.
 
Last edited:
I would think your advice is still good Lancie. The chances of them both going true at the same time in a millisecond world is probably nil.
 
I would think your advice is still good Lancie. The chances of them both going true at the same time in a millisecond world is probably nil.

That's what I would have thought, but it seems more likely than I would have ever dreamed in this particular application.

Cardboard boxes coming at each other on conveyors at right angles, needing to occupy the same conveyor.(Traffic cop ) The boxes are detected by photocells and there are physical pop-ups and solenoids etc to stop one or the other, but one needs to wait for the other.

I am at the point of believing that the inputs are going from false to true from one rung to another, and it is screwing up the works.

which ever one takes precendence needs to latch the other out

thank you both for your replies... if you have any more advice now that I've explained the situation a little more, I'd like to hear it. thank you
 
Copy the real inputs to flags on the rung just before, then use these where you previously used the inputs. This will snapshot the input image, and you can then prioritise/lockout the second one.
pp
 
From AB:

"...it is possible for an input to change state during program scan execution. If this is a concern, buffer input data so our logic has a stable copy of data during its scan. Use the Synchronous Copy (CPS) instruction to copy the input data from our input tags to another structure and use the data from that structure."
 
The boxes are detected by photocells and there are physical pop-ups and solenoids etc to stop one or the other, but one needs to wait for the other.
Maybe for the line that has priority, you could move its photocell slightly ahead of the other one, so that it would see a box a split second before the other photocell. Also, the photocells could be different brands or models, so that one actually has a faster detection time. Make sure they are the same brand and model so that possibility is minimized. Even then, one may be faster than the other.
 
Never underestimate conveyors!

If a package is to be passed from one conveyor to another then firstly, the following conveyor must be "free". Once the downstream conveyor has accepted the transfer then it is no longer free to accept a package from another source. While AB I/O may be asynchronous (why?), I don't think that the code execution is asynchronous so executing the code for the priority conveyor first should result in it having priority.

Maybe I missed something - sorry Siemens programmer not AB but the most of the principles are the same.

Nick
 
Maybe for the line that has priority, you could move its photocell slightly ahead of the other one, so that it would see a box a split second before the other photocell. Also, the photocells could be different brands or models, so that one actually has a faster detection time. Make sure they are the same brand and model so that possibility is minimized. Even then, one may be faster than the other.

Lancie, I hope you are not offended by this, but we think alike.

I have spent a good bit of time doing just those things... the problem is, when all else is said and done,...timers, ...location etc... it is still possible that both inputs are made true at the same time. It seems to just change where it happens.

I am going to try your idea of putting one ahead of the other on adjacent rungs and parrafin's idea to make the inputs use latching bits. I am also going to look into the synchronous copy instruction. I am not familiar with that

thank you all
 
Last edited:
Since you are trying to "prevent" a very low chance event, I would actually look for the instance when the two inputs are both true via code and then "make the proper decision(s)"; after all, you cannot foresee the real time "incident" nor quite "control" it; it is a matter of the CPU scan "experiencing" it and the "watchdog AND" logic would "trigger" only when needed.
 
Some questions need answers....

1. Are the 2 photocell inputs in the same Input Module ?

2. Are the 2 photocell inputs in the same Chassis ?

3. Are the 2 photocell inputs in the "local" chassis ? (i.e. same chassis as the controller.

4. What type of Input cards are you using ?

There may be ways of getting round the problems you are facing... but probably the simplest is to wire the photocells to an SOE (Sequence-Of-Events) input module. The module itself will timestamp the input transitions, and you can react accordingly in the logic.
 
Code:
-----|/|-----{Solenoid 1}
    SOL 2
 
-----|/|-----{Solenoid 2}
    SOL 1

Just interlock the Pop-up Stops and Reverse the Air. Solenoid Off Stop is Up. This way you Energize to release.
 
This seems like it should be simple day one programming, but it has been kicking my butt.

COntrolLogix5000

two inputs ... How can I program the ladder logic so that one input takes precedence over another if they go true at the same time, and prevent the other from having any effect until I allow it.

thank you
I always try to think simple, in cases like this.
Is there any chance that there's some kind of cross-talk or goofy wiring somewhere that is really causing the input of both states to the same state, at the same time?

Or, if this is really true, you can manipulate the filter time of the input of the 1756 module...some can apply different filters to different parts of the card...that way you could FORCE a delay, when they appear at the same time.
 
I always try to think simple, in cases like this.
Is there any chance that there's some kind of cross-talk or goofy wiring somewhere that is really causing the input of both states to the same state, at the same time?

Or, if this is really true, you can manipulate the filter time of the input of the 1756 module...some can apply different filters to different parts of the card...that way you could FORCE a delay, when they appear at the same time.

Thinking simple, in my opinion, disregards the actual mechanism of the transfer of physical inputs into the controller's database.

The input modules "produce" the data onto the network, and connected controllers "consume" it, at the rate specified by the RPI setting for the module.

If the RPI for a module is 20mS, you will not be able to determine which input came on first in that time-frame, which is why A-B make the SOE modules.....
 
All this talk of synchronous/asynchronous, bus speeds response times etc. doesn't matter a rats @rse. What matters is how the program handles the priority of one stream over another given that at some point both inputs may be true when the program executes.

Considder the situation that both inputs are true when the system is switched on. The two streams cannot be mutually exclusive or it will sit there for ever without human intervention. One must be given priority and this will be in code not selection of inputs or sensors.

Nick
 
Last edited:

Similar Topics

Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
2
Views
39
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
13
Views
211
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
8
Views
173
Hi, I have questions. I have Analog Input that need to put into Ignition Designer. But I don't know how to put?
Replies
1
Views
78
Omron AD081-V1 Analog Input Card Offset & Gain Adjustment Entering Adjustment Mode 1. Set the input card in adjustment mode (Turn ON Dip SW No-1)...
Replies
0
Views
56
Back
Top Bottom