David,
I probably made a few errors. One I noticed after I posted is that on the last Rung 28, 4th input branch, the C406 address should be C306, because Divert Lane 3 is really your last photosensor. That branch is an attempt to catch the boxes that do not get diverted and remove them from the Counter 1 accumulator as they pass by the last photosensor. If this does not work, then you will have to add another set of rungs for a 4th bit-shift register.
I probably made a few errors. One I noticed after I posted is that on the last Rung 28, 4th input branch, the C406 address should be C306, because Divert Lane 3 is really your last photosensor. That branch is an attempt to catch the boxes that do not get diverted and remove them from the Counter 1 accumulator as they pass by the last photosensor. If this does not work, then you will have to add another set of rungs for a 4th bit-shift register.
Doug, yes you could use overlapping addresses in the Block Copy Source and Destination, but the Length is always "1", not a variable. Probably you could use the For-Next instructions to create a loop to do the Block Copy enough times to get to the desired bit. That might save a couple of rungs in the program.The screen shot you posted of the instruction does not explicitly state that source and destination addresses cannot overlap so I'm ASSUMING that my initial move of n+1 to n+0 would work.
Last edited: