[RobotStudio study notes] (eight) modular program

When the program is more complicated, or there are repetitive parts in the program, modular programming is often a more feasible method. In RobotStudio, different routines can be called in the main program to achieve the purpose of making the code logic clear.

Save the movement of the workpiece as a routine

  1. Enter the routine, create a new routine

  2. Go back to the main program, select the first line with the mouse, click Edit-Edit, and copy the code in the main function to the newly created routine
  3. Go back to the newly created routine and paste the main function code.
  4. Use debug-pp to move to the routine to test whether the routine is correct. If there is no problem, replace the content of the main function with the instruction procall.


Quickly move the second workpiece

  1. First make a copy of the routine for handling the workpiece

  2. Because the position of the workpiece is determined by bias using the workpiece coordinate system of the warehouse, only the parameters of the Offs function need to be modified to determine the gripping position of the second workpiece.

Guess you like

Origin blog.csdn.net/weixin_44543463/article/details/113666063