Variable waypoint

Hello. I am new with Universal Robot.
I am doing simple pick and place program. For place section, the work is in the fixed position, so there is no problem.
For the pick section, the work is not in fixed position, and it changes every 5mm from z axis for 5 types of work (work tall is 50mm to 70mm).
Can anyone suggest the best command and show me how to do the programming for the pick section.

Thank you in advance

If the pick location (X & Y are constant) you can create a fixed waypoint say 80mm above the surface of table (over the part pick location), then:

  1. Close gripper
  2. moveL() in -Z direction of base UNTIL contact (set speed to 100mm/s or less)
  3. Retract in +Z direction of base UNTIL distance (enough to open gripper fingers without moving part)
  4. Open gripper
  5. moveL() in -Z direction of base UNTIL distance (enough to get good grip of part)
  6. Close gripper
  7. moveL() to initial fixed waypoint

…carry on with your program

Hope this helps, and best of luck!