Contents
  1. Save the workpiece handling action as a routine
  2. Quickly handle a second workpiece

When a program is relatively complex, or when repeated sections appear within a program, modular program design is often a viable approach. In RobotStudio, you can call different routines from the main program to keep the code logic clear.

Save the workpiece handling action as a routine

  1. Go to Routines and create a new routine Save the workpiece handling action as a routine Save the workpiece handling action as a routine (2)
  2. Return to the main program, select the first line with the mouse, click Edit > Edit, and copy the code inside the main procedure into the newly created routine Save the workpiece handling action as a routine (3)
  3. Return to the newly created routine and paste in the main procedure code. Save the workpiece handling action as a routine (4)
  4. Use Debug > PP to Routine to test whether the routine works correctly. If everything looks good, replace the main procedure content with a ProcCall instruction. Save the workpiece handling action as a routine (5) Save the workpiece handling action as a routine (6) Save the workpiece handling action as a routine (7)

Quickly handle a second workpiece

  1. First, duplicate the workpiece-handling routine Quickly handle a second workpiece Quickly handle a second workpiece (2)
  2. Because the workpiece position is determined by offsetting from the warehouse workpiece coordinate system, you only need to modify the Offs function parameters to set the pick position for the second workpiece. Quickly handle a second workpiece (3)