RobotStudio event

Set DO at Home

Hello everybody

A little background first. I have only been working with robots for about 3 months most of which was with fanuc. We are currently doing a project with ABB robots which no one in our shop has much experience with. I have been teaching myself most of it so far and am currently stumped. 

I need to set a DO when the robot is at Home and at Perch position and turn it off when I leave the position. I know in fanuc I would just use a reference position and be done with it however from what I can see that doesn't really exist in a ABB robot. From my research the way you have to do it is with World zones. I have been trying to understand what I need to do to create this but am just confusing myself more. I've read the description on the wz commands but its still not making alot of sense to me right now. 

Could someone try and spoon feed this Robot Newbie on how to accomplish what I am wanting to do. 

Thanks in advance!!

Answers

  • WZHomeJointDef would be the best option.  You can find it in the Rapid Instructions, functions and datatypes manual.
    Lee Justice
  • Thanks for the response!! I looked into it and referenced the example in the manual. This is what I came up with however I am getting a Syntax Error where I declare my VAR . I have the wzstationary in a different module saved as global. And am getting an error on the pendant saying Expected 'trap' but found 'var' 

    Again sorry if I'm a little slow to this still trying to learn it all. 

    here is what I have written 



    VAR wzstationary wzHome;

    PROC power_on()

    VAR shapedata joint_space;

    CONST jointtarget jHome:=[[-65.7348,18.287,-18.0925,2.01863,90.7723,197.426],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST jointtarget delta_pos := [ [ 2, 2, 2, 2, 2, 2], [ 5, 9E9, 9E9, 9E9, 9E9, 9E9] ];

    WZHomeJointDef \Inside, joint_space, jHome, delta_pos;

    WZDOSet \Stat, wzHome \Inside, joint_space, Home, 1;

    ENDPROC   


  • Move your other data declarations out of the PROC.
    Lee Justice
  • Sorry for the late response I've been being pulled to other jobs. If I move all the Data declarations out of the proc then they all give me a syntax error. If I put them all in the proc then when I got to run the program it tells me my worldzone Wzhome is defined locally and needs to be global. However when I check my wzstationary  wzhome it shows it is stored globally. I have even moved it to the same module and get the same error. 
  • How did you move the data declarations?  With a text editor offline?  Try through the pendant or Robotstudio.  Just one at a time.  The delta_pos might be able to stay, but being global in the same module ought to be OK.
    Lee Justice
  • Yeah I was using robot studio to make all my changes while connected to the controller. 
  • This is at the top of my main module 

    MODULE Module1
    VAR wzstationary wzHome:=[1];
    VAR shapedata joint_space;

    and then this is how my proc looks

    VAR wzstationary wzHome;

    VAR shapedata joint_space;

    CONST jointtarget jHome:=[[-65.7348,18.287,-18.0925,2.01863,90.7723,197.426],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST jointtarget delta_pos := [ [ 2, 2, 2, 2, 2, 2], [ 5, 9E9, 9E9, 9E9, 9E9, 9E9] ];

    PROC power_on()
       
        
    WZHomeJointDef \Inside, joint_space, jHome, delta_pos;

    WZDOSet \Stat, wzHome \Inside, joint_space, Home, 1;

    ENDPROC   

    everything in bold has a syntax error in robotstudio. 
  • Simmu
    Simmu
    edited February 2023
    In your example you have declared wzHome twice which would definately give you an error, although a semantic one.
    And also, maybe a stupid question, but do you have other routines (PROC) between the declarations in the module header and the PROC power_on? That would explain the error text "Expected 'trap' but found 'var'"
    All module related declarations must always be in the top of the module, before all Routines.
    And another stupid question, have you checked that your system is equipped with the Software Option "World Zones"? Because otherwise you will not have the WZ... commands working anyway.

  • Yes, having the same named variable in the PROC will mask the global variable.  It will be local to that proc and will be an issue.
    Lee Justice
  • I got it all sorted out thanks for all the help!!
  • I didn't realize I had to declare them at the top of the module before any routines. And Yes I noticed I had it declared 2 times and took care of that. Thanks again for all the help guys.