I am running a Cognex Vision system on the pc interface that will be looking at our part held by the robot to determine offsets for machining location. I want to have an error safety built in so if the robot fails to pick a part from the loader and the camera has an error (from not identifying a part), the robot goes back through the pick up procedure again. I have an if statement to check the output from the camera and i can get the arm to go pick up the part again but then when it leaves the if statement it, it does not continue the program. I need a way to basically start the PP to Main if it receives an error so it just restarts. What is the best way to do this? I want to run the machine lights off and want to make sure when i come in the next day it didn’t miss a part and stop early in the cycle.
I have posted the a snip from my code but not sure the best way to post it here to review.



