path recovery after e-stop was triggered

if i use PathRecStop; in the error handler, then the program execution stops with: 10020: Execution error state
Description
The program execution in task T_ROB1 has been stopped due to a spontaneous error.

ERROR (ERR_MY_ERR)
IF ERRNO=ERR_MY_ERR THEN
StopMove;
PathRecStop;
StorePath;
SetDO doEStopTriggered,0;
p1:=CRobT(\Tool:=weldgun\WObj:=Workobject_1);
MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;
ArcLStart p1,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
RestoPath;
StartMoveRetry;
ENDIF

so i wrote it like this , and it works like a charm, but only once! if i pres the E-stop again, it just starts where it left off, does not enter the error handler

MODULE Event(SYSMODULE)
PROC QStopTriggered()
SetDO doEStopTriggered,1;
ENDPROC
ENDMODULE

PROC main()
IDelete intETriggered;
CONNECT intETriggered WITH stop_now;
ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;
Path_10;
ENDPROC

PROC Path_10()

ArcLStart Target_10,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ArcL Target_20,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_30,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_40,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcL Target_50,v1000,seam1,weld1,z10,Weldgun\WObj:=Workobject_1;
ArcLEnd Target_50,v1000,seam1,weld1,fine,Weldgun\WObj:=Workobject_1;
ENDPROC

TRAP stop_now
VAR robtarget stop_pos;
StopMove;
PathRecStop;
StorePath;
GetSysData Weldgun;
GetSysData Workobject_1;
stop_pos:=CRobT(\Tool:=Weldgun\WObj:=Workobject_1);
MoveL Offs(stop_pos,0,0,20),v50,fine,Weldgun\WObj:=Workobject_1;
MoveL Service_Pos,V1000,z20,Weldgun\Wobj:=Workobject_1;
MoveL stop_pos,v1000,fine,Weldgun,\WObj:=Workobject_1;
SetDO doEStopTriggered,0;
RestoPath;
StartMove;
ENDTRAP
ENDMODULE

i also wrote it like this and it works perfect, but only once, if i press e-stop again than it wont enter the trap routine, it just start welding from where it left of like after a normal e-stop

so we are on the right path, but not quit there yet :)), why cant i find this information in any rapid manual? am i not looking in the right manuals? all the examples that i find in the manuals are for normal error handling nothing related to E-stop. How do other users handle an E-stop trigger by accident (like walking into light curtains, or opening the safety door by force, or just pressing the E-stop by accident)
Thank you so much for your help guys!!!

It works only once because of the line that enables the interrupt for the digital output:

ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;

The “\SingleSafe” argument makes it possible to activate the interrupt after resuming the program (exactly what you were looking for). However the Single part means the interrupt will only be triggered once. From the technical reference manual (3HAC050917-001) about the Single argument:

Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs once at the most. If the Single and SingleSafe arguments is omitted, an interrupt will occur each time its condition is satisfied.

To work around this, you can delete and reconnect the interrupt at the top of your TRAP routine (stop_now), like this:

IDelete intETriggered;
CONNECT intETriggered WITH stop_now;
ISignalDO\SingleSafe,doEStopTriggered,1,intETriggered;

About the question for good RAPID documentation, check the RAPID Overview manual (3HAC050947-001)

Thank you Nicola!

Just read about the singlesafe, found it in the rapid manual
If i set it like you sad then after the trap routine start path 10 all over again , does not start where it left off

Had an exitcycle at the end of the trap routine (was experimenting with it) that is why it started path 10 from begining.
Deleted the exitcycle, and now it works 100% every time i pres E-Stop does the trap routine then returns from where it left off.

Thank you guys for your help !!!

Hallo, thats right. You have to use \singlesafe switch to have the interrupt working after a quick stop.
But it will work only once, so you have to reconnect in the trap-routine.
Your case is special, because you intend to go to a cleaning position after the e-stop.
Usually you just continue bei pressing start. Especially when welding, the robot will perform a restart a little bit backwards automatically (if configured in the error handler).
A description of the method you will find in Technical reference Manual-Rapid Kernel 3HAC16585-1, , Revision G
Controller software IRC5 RobotWare 5.12.

And if you modify the TRAP routine like this?.

TRAP stop_now
VAR robtarget stop_pos;
StopMove;
PathRecStop;
StorePath;
IDelete intETriggered;
SetDO doEStopTriggered, 0;
GetSysData Weldgun;
GetSysData Workobject_1;
stop_pos := CRobT(\Tool:=Weldgun\WObj:=Workobject_1);
MoveL Offs(stop_pos,0,0,20), v50, fine, Weldgun \WObj:=Workobject_1;
MoveL Service_Pos, v1000, z20, Weldgun \Wobj:=Workobject_1;
MoveL stop_pos, v1000, fine, Weldgun, \WObj:=Workobject_1;
RestoPath;
CONNECT intETriggered WITH stop_now;
ISignalDO \SingleSafe, doEStopTriggered, 1, intETriggered;
StartMove;
ENDTRAP

EDIT: Nevermind, I see that it’s working now, super!

Thank you Matti you are a hero !!!