Hello,
I am trying to create a routine that will act as an intteruppt to send the error code to the plc when any fault occures on the robot.
Using this forum, I have created this logic, but this is not working. Does anyone have any corrections, or another way to do this?
Thank you,
MiRobotGuy
PROC main()
!setup for error trapping
CONNECT err_interrupt WITH trap_err;
IError COMMON_ERR,TYPE_ERR,err_interrupt;
!
BeginLbl:
!
nCycleCount:=nCycleCount+1;
!
rDoSomething;
!
WaitTime 1.0;
IF bZ_Reloop=TRUE THEN
GOTO BeginLbl;
ENDIF
IDelete err_interrupt;
ENDPROC
TRAP trap_err
!Trap to get fault data + fault history
GetTrapData err_data;
ReadErrData err_data,err_domain,err_number,err_type;
!send error code
SetGO GO_RbtErrCode,err_number;
ENDTRAP