Working pick and place programs for KUKA and ABB. The robot searches down from the approach position and finds the part automatically — no fixed pick height to teach. Every line annotated so you can learn the pattern, not just run it.
Fixed pick heights break the moment your stack height varies — different part counts, compressed packaging, mixed batches. A search routine removes the problem: the robot moves down slowly from the approach position while watching a sensor input, and stops the instant the part is detected.
On KUKA, INTERRUPT DECL 1 WHEN $IN[1]==TRUE arms a background watch on the gripper sensor. On ABB, SearchL does the same job natively.
The robot moves down from the taught approach position. The moment the input goes TRUE, the interrupt fires — BRAKE stops motion immediately.
The contact position is stored and used as the real pick point. The gripper closes, the robot lifts clear, places, and repeats.
| XP_HOME | Robot home / safe position |
| XP_PICK_APP | Approach above the pick — search starts here |
| XP_PLACE_APP | Approach above the place position |
| XP_PLACE | Final place position |
| $OUT[1] | Gripper close / vacuum on |
| $IN[1] | Contact sensor / vacuum feedback — triggers the search interrupt |
No pick position to teach — the search finds it. Configure $TOOL, $BASE and your port numbers, then test at 5% override first.
| pSearchTop | Top of search — teach the position the robot searches down from, above the part (the demo just uses its current position after jHome) |
| pPlace | Place position — the demo calculates it as an offset from the pick; on a real robot, teach your actual place position |
| diPartFound | Digital input to create — part detection sensor (vacuum switch, photoeye, proximity) |
| doGrip | Digital output to create — gripper close / vacuum on |
The file runs in RobotStudio as-is with no I/O setup — the search and gripper are simulated. The comments walk you through the real-robot version step by step: teaching the positions, creating diPartFound and doGrip (Controller → Configuration → I/O System → Signal), and the exact SearchL and SetDO lines that replace the simulated moves.
The Path2 generator builds complete KUKA KRL and ABB RAPID palletizing programs from your pallet pattern and box sizes — including gripper signals, separator sheets and depalletizing. Validated in RobotStudio and tested on a real KUKA robot.
Open the palletizing generator →