I am trying to see the holder and the can (with out hundreds of lines of logic) at the start and make sure it is the same at the end. That way we know if a can has fell. Is there a way to do this logically?
I am answering this at your original post to help keep the responses together in case someone else wants to join the discussion.
Yes, I can see how it could be done. At the can-loading point, you insert a 1 or 0 into a bit-shift stream that essentially saves the string of bits (including ones that are unloaded or 0) into a 400-bit memory range (call it B3:0/0 to B3:24/15 which should be about 25 words x 16 bits). Then at the end, as each can holder passes a sensor, you compare its current sensed value at Sensor S3 with the previous value that was stored in the BSL register.
I can help you set up the BSL to do this. You will need several bits of information:
1. Most important is something to use to index the BSL, shifting it one bit each time the physical can holders move 1 position. If your have two sensors at the loading point, aim one at the holder frame so that when a new frame (empty or not) comes to the loading point, the sensors returns a TRUE or 1, then that bit can be used to advance the BSL (call is Sensor 1 input at I:1/6).
2. You need a Sensor #2 at the can loading point to insert a 1 or 0 into the BSL, as the BSL is indexed or advanced by Sensor #1. Say Sensor S2 is wired to Iput I:1/7).
3. You need a Sensor #3 at the end, or at bit-shift position 400, say S3 = I:1/8. Luckily, you need only 3 sensors and that is what you have. Funny how that worked out, isn't it?
Your logic rung for the end-of-line at Sensor #3 would look something like this: (See attached picture). Of course you will need to use something other than the NEQ for comparing bits (instead of words). What bit instructions could you use when say B3:24/15 = 1, then is I:1/8 = 0 at that same time?
You will need to add all the bells and whistles to make a complete system. For example, when you first start the chain running, the first 359 positions at the end will not have any data. Can you think of a way to work around that problem? What if you used a counter and counted the first 359 postions and ignored those until the counter = 400 or greater?