RobotStudio event

Error handler/Trap routine

Hi all,


I am currently working on a auto recovery program so that the operators don't have to manually recover the robot as many of them on site aren't trained to use these. As a result in this we are experiencing many crashes when they are attempting to recover weld faults.


As a result of this i have tried to create my own error handler to automatically recover the robot in fault. I am using a semi static task to to monitor if the robot is welding and moving.


MODULE mMain

VAR clock clkR1_MOVE;

VAR num nR1_Move;


PROC MAIN()

WHILE TRUE DO

IF DOutput(do_MonitorStop)=1 THEN

GOTO END;

ENDIF

ClkStop clkR1_MOVE;

ClkReset clkR1_MOVE;

WHILE DOutput(do_R1_Not_Moving)=1 AND DOutput(do_R1_Welding)=1 AND DOutput(doR1_AWError)=0 DO

ClkStart clkR1_MOVE;

nR1_Move:=ClkRead(clkR1_MOVE);

IF DOutput(do_R1_Not_Moving)=1 AND DOutput(do_R1_Welding)=1 AND DOutput(doR1_AWError)=0 AND nR1_Move>3 THEN

PulseDO\PLength:=1.5,do_R1_StopFault;

ENDIF

ENDWHILE

WaitTime 0.05;

ENDWHILE

END:

WaitTime 0.05;

ENDPROC

ENDMODULE


Using this monitoring I am calling a trap routine to raise an error. Unfortunately this is where I am struggling as I am pretty much self taught using RAPID. I am trying to use the error code below to call the automatic recovery using a UI message box so the operator has to acknowledge the fault before it starts to move back through the program to the determined safe areas within the actual welding program.


TRAP R1_Stop_Fault

RAISE err_R1_Weld_Fault;

ERROR


IF ERRNO=err_R1_Weld_Fault THEN

R1_Recover:=UIMessageBox(\Header:="R1 Automatic Recover to Safe Point"\MsgArray:=maint_msg1\BtnArray:=maint_btn1\Icon:=iconInfo);

IF R1_Recover=1 then

StorePath;

PathRecMoveBwd\ID:=Safe1;

Stop;

RestoPath;

StartMove;

ENDIF

ENDIF

RETURN;

ENDTRAP


Any time I go to test this it either pops up with interrupt queue full and value error. Or it just skips this all together and calls ABB's generic arc supervision error.


Any pointers in the right direction will be highly appreciated.


Thanks


Sam

Comments

  • lemster68
    lemster68 ✭✭✭
    All of this code is in the background task?  I suppose you used the Connect instruction to bind the trap routine, you just have not shown it.  Interrupt queue full is because you need to use ISleep, IDelete or specify the interrupt to be \Single.
    Lee Justice
  • The first part of the code is in the background task. Once the conditions are met in the background task it then calls the trap routine in the main program. In the main program the trap routine is connected to the monitoring program. We used to use the trap routine to call a simple message to state which robot was in fault and would stop the process. I tried using Isleep on the standard arcware recovery but then nothing would happen. The program pointer would just sit on the Arc move and not continue.


  • Hallo, why you are not using the standard RW Arc error handler?