RobotStudio event

home position signal request

Options
Dear All,
I am new at ABB Robot programming.
I commissioning ABB robot with Siemens PLC. I need home postion signal at PLC side. Please show me rapid pseudo code on robotstido.
As my research, I may use 
""""WZHomeJointDef\Inside,joint_space,HomePose,delta_pos;
WZDOSet\Stat,wzHomePose\Inside,joint_space,doAtHomePose,1;"""

Could you help ?


Answers

  • mandolas
    Options
    Hi ...
    Yes it can be like this. For this an area needs to be created, so when the robot is in this area it will set the output for the PLC.

    See if that helps...

    ! Declaration of the signal in the menu "Configuratio\IO\Signal" in case of communication with profinet
    -Name "RobotHome" -SignalType "DO" -Unit "DSQC688_PROFINET"\
           -SignalLabel "SIGNAL OF ROBO ACCESSING THE HOME AREA" -UnitMap "10"\
           -Access "ReadOnly"

    ! In a module it can be done this way...
    MODULE ModuleWZ

         ! #################### POSITIONS TO BE USED TO DEFINE OBJECT AREAS - USED: tGripperG and wobj0;
         LOCAL CONST robtarget PBOX_HOME_L:=[[765,0,1390],[2.45295E-05,9.20422E-06,-1,-2.25732E-10],[0,0,-1,0],[9E+ 09.9E+09.9E+09.9E+09.9E+09.9E+09]];
     

         !! ZONE DEFINITION: HOME ############################################### #############
         CONST pos cornerInfEsq_HOME:=[PBOX_HOME_L.trans.x-50,PBOX_HOME_L.trans.y-30,PBOX_HOME_L.trans.z-50];
         CONST pos cornerSupDir_HOME:=[PBOX_HOME_L.trans.x+50,PBOX_HOME_L.trans.y+30,PBOX_HOME_L.trans.z+50];
         VAR shapedata shape_HOME;
         VAR wzstationary wzstat_HOME;


         !! PROCEDURE FOR DEFINING OBJECT AREAS ############################################## ##############
         ! This routine is linked to the PowerOn event
         !
         PROC DefineWZ()
                 ! AREAS OF MAPPED OBJECTS
             !Wordzone definition HOME zone
             WZBoxDef\Inside,shape_HOME,cornerInfEsq_HOME,cornerSupDir_HOME;
             WZDOSet\Stat,wzstat_HOME\Before,shape_HOME,R2_RoboAreaHome,1;
         ERROR
             ! #################### ##################### !
             ! #################### Handling error #################### !
             ! #################### ##################### !

             IF ERRNO=ERR_NO_ALIASIO_DEF THEN
                 ErrWrite "ERR_NO_ALIASIO_DEF",""
                     \RL2:="The signal variable is a variable declared in RAPID. It has not been connected"
                     \RL3:=" to an I/O signal defined in the I/O configuration with the AliasIO instruction.";

                 TRYNEXT;
             ENDIF

             IF ERRNO=ERR_NORUNUNIT THEN
                 ErrWrite "ERR_NORUNUNIT",""
                     \RL2:="There is no contact with the I/O device.";

                 TRYNEXT;
             ENDIF

             IF ERRNO=ERR_SIG_NOT_VALID THEN
                 ErrWrite "ERR_SIG_NOT_VALID",""
                     \RL2:="The I/O signal cannot be accessed. The reasons may be that the device"
                     \RL3:=" I/O not working or an error in the configuration.";

                 TRYNEXT;
             ENDIF
         ENDPROC
    ENDMODULE

    ! Execute the routine call in the PowerOn event