@tom24, I'm not exactly sure what is available with the RG2 gripper, but the Robotiq gripper as an object detected function that can be used in such case. If your gripper has the same kind of functionality you can use the same logic. I'm using a loop in which my pallet wizard is located, looping until I have a part that is detected by my gripper. If not, I'm moving to the next position. Find program attached.
Program
BeforeStart
picked≔ False
Gripper Open (1)
Robot Program
MoveJ
home
picked≔ False
Call pallet_sub
pallet_sub
Loop picked≟ False
Gripper Open (1)
Pallet
Pattern: Square
Corner1_1
Corner2_1
Corner3_1
Corner4_1
PalletSequence
Approach_1
PatternPoint_1
Gripper Close (1)
Grip Check
If object detected
picked≔ True
Wait: 1.0
Exit_1
How the RG2 gripper detected a part during palletizing. For instance, if I have 12 part in a pallet and then I need to pick the first part but if there is no part in the first point how it moves to the next point to pick the part and exit instead of moving to the next waypoint? I highly appreciated for the help.