# StorePath while SearchL error.

**URL:** <https://tech-community.robotics.abb.com/t/storepath-while-searchl-error/11427>\
**Category:** RAPID Programming\
**Tags:** searchl, rapid-code, trap\
**Created:** [May 6, 2024, 8:41am UTC](https://tech-community.robotics.abb.com/t/storepath-while-searchl-error/11427 "2024-05-06T08:41:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Audrius](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Audrius](https://tech-community.robotics.abb.com/u/Audrius)\
**Post date:** [May 6, 2024, 8:41am UTC](https://tech-community.robotics.abb.com/t/storepath-while-searchl-error/11427/1 "2024-05-06T08:41:05Z")

</div>

Hello,  
I have TRAP function which moves robot to safe heigh, then moves to safe pont, then moves to home point, and after this function I resseting pointer to main. This funtion is called from PLC when operator sees that something might go wrong. TRAP funtion required to have StorePath which I dont need, because I’m not restoring path. Everything works well, but sometimes operator might call this function while searchL in progress, and then I’m getting error that SorePath cannnot be executed while SearchL in progress. And I dont know how to solve it.

And another problem with this TRAP functions is as follows:  
When operator sees that something will go wrong, he stops the robot program execution and hits “Park robot” button. When this button is on, it sets trap input to high, turns on robot motors and starts program execution, but before trap is activated robot for a while(~1 sec) continues its last move, and in some cases there can be collision in that move

Maybe I’m using bad approch with this function? I have not much experience with this.

RAPID code:

TRAP ParkRobot  
IF getDeviationFromHome() \> maxDeaviationFromHome  
THEN  
DoParkRobot;  
ELSE  
Reset Local\_IO\_0\_DO3;  
Reset Local\_IO\_0\_DO4;  
MoveL Offs(trg\_product\_prepickup,0,-100,0), v100, fine, tool1;  
MoveL trg\_product\_prepickup, v100, fine, tool1;  
ENDIF  
SetDO A\_Delta\_DO9, 1;  
WaitTime 1;  
SetDO A\_delta\_DO9, 0;  
WaitTime 1;  
Reset A\_delta\_DO16; !Komanda nebevykdoma  
Stop;  
ENDTRAP

PROC DoParkRobot()  
CONST robtarget trg\_drop\_boxes:=[[1780,1320,-245],[0,-0.689808,0.723992,0],[0,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
CONST robtarget trg\_droped\_boxes:=[[1780,1320,600],[0,-0.689808,0.723992,0],[0,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
VAR robtarget currRobT;  
parks:= parks + 1;  
StopMove;  
StorePath;  
currRobT := CRobT();  
SetDO Local\_IO\_0\_DO5, 0;  
SetDO Local\_IO\_0\_DO9, 0;  
currRobT.trans.z := 1850;  
MoveL currRobT, v200, z50, tool1;  
MoveJ trg\_transit, v200, z50, tool1;  
MoveL trg\_drop\_boxes, v200, fine, tool1;  
WaitRob \ZeroSpeed;  
ReleaseBoxes;  
PullClaws;  
WaitForClawsPulled;  
MoveL trg\_droped\_boxes, v200, z50, tool1;  
MoveL trg\_product\_prepickup, v200, fine, tool1;  
WaitRob \ZeroSpeed;  
ENDPROC

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [May 6, 2024, 3:32pm UTC](https://tech-community.robotics.abb.com/t/storepath-while-searchl-error/11427/2 "2024-05-06T15:32:33Z")

</div>

I hate to say it because I personally don’t like the StartMain system input, but you might be well off to use that system input. Put your Park routine at the top of the main program and don’t use the trap at all.
