I just received this PM from dandrade...
Hello Eric. Congratulations, end the work inspection.
I have, not compresion "the situation". the conditions it sometime 03 ???
1- Box detect + Inspection OK
2 -Box detect + Inspection not OK
3- Box detect + Inspection fail.. not get the box
You solve problem 03? Correct? I read PDFs and picture solve, by rube... sometime not get situation for relation code... Clear please.
Others may have the same question, so I'll answer within the thread.
If you'll notice in my program, I am NOT using the 'box detect' to load the FIFO stack. The camera's PASS or FAIL signal is the only thing that loads the FIFO. If I used the 'box detect' signal to load the FIFO, the PASS/FAIL data from the camera would not enter the stack, as this data is not present when the box is detected. The camera must aquire and process the image before it can give a result, so there is a delay, which can vary from image to image.
Loading the FIFO:
1.) Box detected at inspection position
2.) Tell camera to inspect box
3.) Camera gives PASS or FAIL result
4.) Place result for this box into FIFO stack
Unloading the FIFO:
1.) Box detected at reject position
2.) Unload camera result for this box from FIFO stack
3.) If result is FAIL, reject box. If result is PASS, allow box to continue
The 'problem' was how the FIFO Unload (FFU) operates. When the unload operation occurs, the current data is unloaded to a separate register (N7:1 in my case).
BUT, it
ONLY unloads when the stack position is >zero (queue not empty). Therefore, if the LAST value unloaded was a PASS value, successive unloads would NOT overwrite this value. If, for some reason (like unplugged?), the camera stopped giving a PASS/FAIL result (no inspection), the stack position would remain at zero, and N7:1 would CONTINUE to contain a PASS value. I wanted a 'no inspection' to result in rejecting the box.
Thanks to AK's suggestion, each time a PASS occurs, the FIFO is loaded with ALTERNATING values of 1 and 2. Therefore, when either a "1"
OR "2" is unloaded at the reject, the product is considered as PASSED. The benefit of having alternating values is that I KNOW that the inspection is occurring. I place the most recently unloaded value in N7:2. When a box is detected at the reject station, the inspection result is unloaded into N7:1. I then compare N7:1 to N7:2. If the camera produced a PASS result, the value in N7:1 will NOT match N7:2, even though both values are PASS values. If they DO match, then I know for sure that the camera did not give a PASS result. This forces the reject cylinder to push the part off the conveyor.
As a side note, this method does not require the camera to give a FAIL output. The LACK of a PASS output produces the same result...
By the way, dandrade, you'll notice I DID add interlocks to my program. Not between the FFL and FFU, but between the PASS and FAIL inputs. If the camera somehow screws up and gives both a PASS
AND FAIL output at the same time, that will be considered a 'no inspection'...
beerchug
-Eric
P.S. I see you snuck in while I was typing, Rube. I would have LOVED to have a pulse from the conveyor for this job!... :nodi: