jthornton
Member
I need to keep a running count of good to bad parts as each part is processed. I came up with the following ladder to keep up with the current quantity of good parts. The bad parts are just the difference from the total parts and the good parts. N7:0 holds the current good part count. N7:0 starts out life with the total count for the Bit Shift so from the git go the math works out correctly. Once the first part is processed if it is good the value in N7:0 remains the same. If the part is bad the value decreses by 1. The value remains at that level unil the bad part passes to the UL bit of the Control for the Bit Shift. The reason is if I get too many bad parts in a row say 10 out of the last 100 I need to shut the machine off and ***** at the operator. Have I missed anything in this logic? Is there a better way?