Bit Shift Question

liberati

Member
Join Date
Sep 2013
Location
Atlanta
Posts
39
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 know the devices we have at our plant to check for under filled cat food cans use an encoder on the conveyor and 3 photo eyes to track the cans. This may be more complicated than you are looking to go or really need.
 
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.
Do you mean that you want to reject the product upstream of the machine that tells you whether the product is good or bad? If so, why? Why not let the machine tell you which is bad? Why does the good/bad inspection need to be done 2 times? Normally a Reject station is located DOWNSTREAM of the device or location that determines Good or Bad parts. Why must yours be upstream? Is this a circular converyor or carousel?
What I would do is and the two together to create an array of when I need to reject.
When using the typical Bit-Shift Register instructions, there is no need to AND two register bits together. If your Good/Bad bit-shift register is being shifted when your actual products travel a scaled distance, then the bad product units will be tracked. A bad unit will arrive at a station at the same time as the bit arrives at a bit address in memory.

Is this the correct way to go about this or is there a better way?
Give more information about your system: the PLC brand and model, how the parts are tracked on the conveyor (encoder, timer, counter, or what)?
 
Last edited:
Do you mean that you want to reject the product upstream of the machine that tells you whether the product is good or bad? If so, why? Why not let the machine tell you which is bad? Why does the good/bad inspection need to be done 2 times? Normally a Reject station is located DOWNSTREAM of the device or location that determines Good or Bad parts. Why must yours be upstream? Is this a circular converyor or carousel?

No I meant to say downstream. I was really tired and had a fat finger.



Give more information about your system: the PLC brand and model, how the parts are tracked on the conveyor (encoder, timer, counter, or what)?

I am using an allen bradley plc and some photoeyes as sensors. The date inspection system is a cognex. I was planning on tracking the product with an eye near the camera and an eye near the rejector.
 
I was planning on tracking the product with an eye near the camera and an eye near the rejector.
It sounds like the product may not be evenly spaced, so that you cannot track "positions" along the conveyor. In that case, you have to depend on the order of the product. You could use a First In, First Out (FIFO) register, with a FFL (FIFO Load) with a "GOOD" or "BAD" word (often 0 and 1 values) inserted at the camera photoeye, and a FFU with a unload at the eye near the rejector.

What I see in many projects is that the programmer tries to tie the FIFO Load and the FIFO Unload operations together so that they must occur at the exact same time. Unless your conveyor has an encoder, that is usually not possible. If it is possible to track the physical part positions, then you are usually better off to use a bit-shift (BSL or BSR) instruction.

The key to a successful FIFO operation is to make the FIFO Load operation and the FIFO Unload operations independent of each other - only the consecutive order of the parts and the Good/Bad status are maintained. That way, a new part can be loaded into the FIFO at any time, and a good/bad part can be rejected from the FIFO, using the FFU at any time. The FIFO register only keeps up with how many parts are between the camera photoeye and the reject station, the order of those parts from First to Last, and the Good/Bad status of each.

At the Rejector, each time the photoeye is triggered, your FIFO Unload is triggered, and the Destination word is examined. If "Bad", you activate the rejector. If "Good", do nothing. That FIFO position disappears into oblivion and the FIFO Position pointer is automatically reduced by 1.

At the camera, each time that photoeye is triggered, the FFL is triggered, and the good/bad status of the next part is inserted into the next empty position in the FIFO register. The FIFO Position word is automatically incremented by 1.
 
Last edited:
liberati,

I had a similar project several years ago and did the following.

1. create a word with a bit shift to detect the part
2. create a word with a bit shift for rejects.
3. I did not use a counter
The products cannot move in such a way that one passes another for this process to work.
4. if you see a reject bit on, reject it, even if there is no pert present. Do not risk letting a bad part go by.

You may even want to create a bit shift word for good parts.
If you see a part at the reject station and there is not a good or bad indicator, reject the part.

I have not used bit shift with an Omron, so I cannot help there.

hope this helps,
james
 

Similar Topics

Good Afternoon, I’m looking at some examples in a SLC 500 and I took notice of a Bit Shift that has the File position with a # B3:25 . What...
Replies
4
Views
1,680
Can someone clarify the BSL instruction for me? Length is that in bits or words? If length is in bits why select any number below 16 as the...
Replies
7
Views
11,784
Hi All. I have a very specific question about tracking using an encoder and bitshift register. We would like to use a Compact or Control Logix PLC...
Replies
40
Views
1,599
Hello. I've been using the answers in this forum for a while now, so thank you. Usually I can find the answer I'm looking for with a basic...
Replies
8
Views
733
Hi, I need some help write a PLC instruction. I am using Proficy Machine Edition 6.5. Our indexing rotating table has 3 nests that are equally...
Replies
15
Views
3,887
Back
Top Bottom