Depalletizing Until Contact No part and skip to next

I am working on a depalletizing routine. The best way to describe is pulling books off a shelf in predetermined positions. Everything works as it should. I am using the Until Contact to find each book on the shelf. My question is if there is not a book in the designated position how do I skip that one and move to the next part? I know I can probably do this with an IF statement not sure how to write the script to go to the next part if none found.

You can check whether the book is present using the “Force” command. Of course, you will also need to use logical variables. If you want something more professional, you can use camera object detection methods.

As you are already doing, you can use the Direction with both Until Contact and a Distance. Then add Actions to both of these and set a variable to either true or false, if the book is found or not.
Then put your whole Pallet template in a Loop that checks the variable. If the book is found the Loop is exited, and if it is not found, the whole Pallet template is run again. :slight_smile:
Remember to set the variable to “not found” before entering the Loop.
Should work for you.

efn
Thank you placing the palletizing routine within a loop worked out perfectly.