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.
| XHOME | Robot home / safe position — all axes near zero, no obstructions |
| XABOVEPICK | Safe approach point above the pick zone — search starts here |
| XPLACE_APPROACH | Safe point directly above the place position (100–200mm above XPLACE_POS) |
| XPLACE_POS | Exact position where the part is released |
| $OUT[1] | Gripper close / vacuum on — set to your actual output number |
| $IN[1] | Part detected / vacuum confirmed — triggers the search interrupt |
No pick position to teach — the search finds it every cycle. XPLACE_APPROACH and XPLACE_POS must be taught before running. See the Before You Run section below.
| 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 KUKA files use two positions that must be taught on the pendant before the program will run correctly. Both are declared in the .DAT file with all coordinates set to zero as placeholders. Here is how to find them and what to teach.
Every KUKA program has two files. The .SRC contains the code. The .DAT contains the position data — the actual X,Y,Z,A,B,C coordinates. When you teach a position on the pendant, KUKA writes the coordinates into the .DAT automatically.
By default the pendant shows programs in fold view — sections are collapsed. To open a fold:
;FOLD)These two positions have zero coordinates in the .DAT when you download. The robot will loop without placing until they are taught. Teach XPLACE_APPROACH first, then XPLACE_POS.
| XPLACE_APPROACH | 100–200mm directly above the place point, same X,Y,A,B,C as XPLACE_POS. Navigate to the PLACE_APPROACH inline form in the SRC, jog to this point, press Touch Up. |
| XPLACE_POS | The exact drop-off point. Navigate to the PLACE_POS inline form, jog to the drop point, press Touch Up. The robot must retract straight back up to XPLACE_APPROACH without sweeping through the placed part. |
Always test at 5% override first and verify each position before running at speed.
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 →