I have a newbie question about tracking product.
I have a machine that is giving me a signal if it sees product and if the product is good or not. The issue is is that I need to reject this product further upstream and am trying to find a way to track it efficiently.
My thought process is as below.
Have a dint that I will use as a register so that I can store the bits for product and product that needs to be rejected.
so the first register would be as below
Bad Product -> A [0][0][0][1][1][1][0][0][0][0]...
Product exists -> B [1][1][1][1][1][1][1][0][0][0]...
so A[5] is the second product which is also the first bad
B[6] is the first actual product
What I would do is and the two together to create an array of when I need to reject.
I would use a sensor upstream to count the items and then reject them accordingly.
The issue is I don't know of a good way to know if the product is good or bad upstream.
I was going to make an array of dints that would have the position of the bad product so [3][4][5]... would be the indexes that I would need to eventually need to remove from the array once they have been rejected.
I'm thinking about having another array of bits that would be a copy of array B and use the index of the bad product indices that would tell me when to reject the product and then remove them from all.
Is this the correct way to go about this or is there a better way?
Thanks,
I have a machine that is giving me a signal if it sees product and if the product is good or not. The issue is is that I need to reject this product further upstream and am trying to find a way to track it efficiently.
My thought process is as below.
Have a dint that I will use as a register so that I can store the bits for product and product that needs to be rejected.
so the first register would be as below
Bad Product -> A [0][0][0][1][1][1][0][0][0][0]...
Product exists -> B [1][1][1][1][1][1][1][0][0][0]...
so A[5] is the second product which is also the first bad
B[6] is the first actual product
What I would do is and the two together to create an array of when I need to reject.
I would use a sensor upstream to count the items and then reject them accordingly.
The issue is I don't know of a good way to know if the product is good or bad upstream.
I was going to make an array of dints that would have the position of the bad product so [3][4][5]... would be the indexes that I would need to eventually need to remove from the array once they have been rejected.
I'm thinking about having another array of bits that would be a copy of array B and use the index of the bad product indices that would tell me when to reject the product and then remove them from all.
Is this the correct way to go about this or is there a better way?
Thanks,