Recently I was involved in an insteresting project, the existing one has one outfeed section feeding out units to let's call it exit A, while the other section which was next to it was sending untis to exit B. The system was re-engineered so that the section for exit B is capable to run FWD-REV upon user selection on HMI application.
The system runs loads at 45 fpm which was troublesome to watch at such speed what happen when the outfeed exit A is feed by the 2 infeeds, as you can observe in the drawing attached, exit A has one common section which must run FWD-REVdinamically.
My first attempt since they already have some sort of tracking code in there to monitor where the actual load is traveling was to use that to create a register to count up how many units where on each of the infeed sections and give priority to the section A first and stop section B until A is empty..
Well, that worked partially as long as they do not take units off the conveyor from such a section for quality inspection, everytime they did that the system get lost and started runnign with unknown sequence. The way they track down units along the conveyors is by usinf proximity switches (PRX) indicated also in my drawing. The code is for RSLogix 5000.
Finally after several trials and some needed modifications to the existing code to avoid this addendum affects normal operation, I realize I could use the proxes to latch which section is feeding the common conveyor to exit A, this resolved the problem of the system getting lost when they pulled out units for inspection because it does not depend on a count, the rule is the load that arrives first to it's sensor it will be latched, say for instance section A and the other one will be stopped upstream sequentially.
Once the common section is clear the opposite section B is then latched and will continue this way until the operator changes the mode. Attached you can see the sample code to achieve this very easy.
Link to RSLogix5000 project file, be patient is a free file hosting it takes only 20 secs: