RobotStudio event

CalcJointT/error handling help

edited May 2016 in RobotStudio

I am trying to do some error handling and having a terrible time trying to figure this stuff out. I am sending target points to RAPID via Sockets and LabVIEW. I am trying to have an error handler check and see if the target is out of reach, or if it will cause a joint limit. If the given target parameters will cause either of these 2 errors, put the RAPID program on "standby" and tell LV an error has occurred, and have the RAPID program wait for LV to tell it what to do. This is my CalcJointT code to try to check for these errors, but it isn't working:

VAR errstr OutReach:="This target is out of reach for the robot arm!";
VAR jointtarget jointpos1;


                        IF ERRNO=ERR_ROBLIMIT THEN
                            SocketSend client_socket\Str:=OutReach;

The error that I keep getting is:"The argument for INOUT parameter ErrorNumber is not a variable or persistent reference, or it is read-only." Any ideas on how to build error handlers that can handle the 2 errors mentioned above, and not to actually stop the RAPID program, but put it in "standby"? Essentially doing target validation before the robot tries to move to that target.

Thanks for any help!


  • Hi Steve, did you make any progress on this? Having trouble solving this issue myself.
  • DenisFR
    DenisFR ✭✭✭
    You code is wrong.
    You have to pass a variable to CalcJointT parameter:

    VAR errnum myerrnum;
    IF myerrnum = ERR_ROBLIMIT THEN