RobotStudio event

Targets in a line using loop - 1D (and 2D/3D)

Options
Hi,
I am coming to RobotStudio/ABB from Staubli V+ and am looking to create a simple program that allows a single target to be moved dynamically within a program. Below is an abbreviated version of how it could be done in V+ - the first point is called StartPoint, and it is shifted along the World X by a distance 'xspace' for each iteration of the loop - hence parts are always picked from one target and dropped in a line - this can easily be extended to 2D and 3D with additional loops. Gripper I/O is OpenI and CloseI; Shift command assumed World Coordinates.
What is the easiest way of doing this in RobotStudio?
Many thanks!

PROMPT "Enter the num. of targets in the x-direction: ", xdim
PROMPT "Enter the target spacing in the x-direction in mm:", xspace
OpenI
FOR loopx = 0 TO (xdim-1)
   SET dropoff = SHIFT(startpoint BY (xspace*loopx))
   MOVE pickup
   CLOSEI
   MOVE dropoff
   OPENI
END

Answers

  • Johannes Weiman
    edited May 2017
    Options
    In RAPID the code would look something like this:

    MODULE Module1
        CONST robtarget pickup:=[[800,-200,600],[0,0,1,0],[-1,-4,3,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
        CONST robtarget startpoint:=[[800,200,600],[0,0,1,0],[0,-5,4,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
        VAR num xdim;
        VAR num xspace;
        PROC Path_10()
            TPReadNum xdim,"Enter the num. of targets in the x-direction:";
            TPReadNum xspace,"Enter the target spacing in the x-direction in mm:";
            SetDO DoOpen0,1; ! Or PulseDO
            FOR loopx FROM 0 TO xdim-1 DO
                MoveJ pickup,v1000,fine,tool0\WObj:=wobj0;
                SetDO DoClose0,1;
                MoveJ Offs(startpoint,loopx*xspace,0,0),v1000,fine,tool0\WObj:=wobj0;
                SetDO DoOpen0,1;
            ENDFOR
        ENDPROC
    ENDMODULE

    https://youtu.be/4En1dicswZk


    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics