Looking at the Method 2 routine again, I don't think I did Rung 0010 correctly. There has to be a way to select the NEXT part, out of all the possible parts between IP3 and IP4. What I have only on Rung 0010 will only look at the B3:1 value of the LAST part that went past IP4. It wil take some more and different logic.
What has to be done On Rung 0010, change the Source for the EQU instruction from "#N7:0" to "N7:1", which was the good/bad value for the FIRST part to pass IP4. Then on Rung 0011, after any bad part has been rejected, you have to copy all Good/Bad numbers up by 1 position, in this order:
Copy N7:2 to N7:1 (replacing the old N7:1 which was just handled).
Copy N7:3 to N7:2
Copy N7:4 to N7:3
Copy N7:5 to N7:4, doing copys up to the value of C5:1.ACC ("5" in this case)
This will insure that the next part to arrive at IP5 will haves its B3:1 condition stored at N7:1.
Once the copying is completed, only then do you trigger the CTD and decrement C5:1 by 1, so C5:1.ACC always shows the number of parts outstanding between IP4 and IP5.
There is an easy way to do the copying using Indexed Addressing, but my atrophied brain has shut down for today. Maybe someone else can take over here and finish this little routine. As an alternative, you could simply use the FIFO method!
What has to be done On Rung 0010, change the Source for the EQU instruction from "#N7:0" to "N7:1", which was the good/bad value for the FIRST part to pass IP4. Then on Rung 0011, after any bad part has been rejected, you have to copy all Good/Bad numbers up by 1 position, in this order:
Copy N7:2 to N7:1 (replacing the old N7:1 which was just handled).
Copy N7:3 to N7:2
Copy N7:4 to N7:3
Copy N7:5 to N7:4, doing copys up to the value of C5:1.ACC ("5" in this case)
This will insure that the next part to arrive at IP5 will haves its B3:1 condition stored at N7:1.
Once the copying is completed, only then do you trigger the CTD and decrement C5:1 by 1, so C5:1.ACC always shows the number of parts outstanding between IP4 and IP5.
There is an easy way to do the copying using Indexed Addressing, but my atrophied brain has shut down for today. Maybe someone else can take over here and finish this little routine. As an alternative, you could simply use the FIFO method!
Last edited: