# SearchL recovery

**URL:** <https://tech-community.robotics.abb.com/t/searchl-recovery/3595>\
**Category:** Robot Controller\
**Created:** [May 21, 2010, 9:35am UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595 "2010-05-21T09:35:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://tech-community.robotics.abb.com/u/philhoward)\
**Post date:** [May 21, 2010, 9:35am UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/1 "2010-05-21T09:35:58Z")

</div>

This might sound like a strange question, but please bear with me.

In doing a SearchL instruction, it sometimes fails with ERR\_WHLSEARCH which is fair enough, but when looking at the robot itself, the sensor would have triggered when motion has completed (maybe due to the part settling?). I tried a recovery from the error handler but it didn’t seem to work:

SearchLStop, diGripperPartOrient2Flanks, pSrchCompl, pSrchEnd, v100, GripperWObj:=wobjA;  
..  
..  
IF ERRNO=ERR\_WHLSEARCH THEN

WaitTime 1;  
IF (diGripperPartOrient2 = 0) THEN  
RETURN;  
ENDIF  
ENDIF

where diGripperPartOrient2 is my input (which goes OFF at the trigger point, hence /Flanks).

This will avoid operators getting involved a lot of the time as this search failure ends up with this situation, where the part ends up in a suitable position to continue, but by this time the error handler has control. Currently I have a handler which returns the tool to the start position and runs the same search again as per most of the examples in the documentation.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![Henrik\_Berlin](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/henrik_berlin/32/1011_2.png) [@Henrik\_Berlin](https://tech-community.robotics.abb.com/u/Henrik_Berlin)\
**Post date:** [May 21, 2010, 10:43am UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/2 "2010-05-21T10:43:53Z")

</div>

Moved to RobotWare forum.

---

<div class="post-metadata">

**Author:** ![Anders\_S](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Anders\_S](https://tech-community.robotics.abb.com/u/Anders_S)\
**Post date:** [May 21, 2010, 2:36pm UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/3 "2010-05-21T14:36:23Z")

</div>

Have you tried this:

IF ERRNO=ERR\_WHLSEARCH THEN  
WaitTime 1;  
IF (diGripperPartOrient2 = 0) THEN  
MoveL StartPosition,v100,fine…;  
RETRY;  
ENDIF  
ENDIF

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://tech-community.robotics.abb.com/u/philhoward)\
**Post date:** [May 21, 2010, 3:53pm UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/4 "2010-05-21T15:53:47Z")

</div>

Yes, Anders - thats what I currently have. The change of signal sometimes doesn’t occur DURING the SearchL move, but on inspection has changed when the product has settled, so I just keep moving the product back and forth and getting nowhere. I wanted to get round the RETRY as it wouldn’t be needed.

The trigger in the SearchL instruction is when diGripperPartOrient2 = 0

---

<div class="post-metadata">

**Author:** ![Thomas\_J](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@Thomas\_J](https://tech-community.robotics.abb.com/u/Thomas_J)\
**Post date:** [May 24, 2010, 2:43pm UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/5 "2010-05-24T14:43:14Z")

</div>

Try setting the searched position to the end position in the error handler if you find the error condition and the search sensor is OFF.

Also if possible set your pSrchEnd deeper to avoid a found condition at the end.

Slow the search down (you can invent your own vSearch data type and set it to 93mm/sec for example…

If none of those work - set a flag in your error handler and handle the error in your calling procedure (splitting the procedures up) and re-search based on the fact you did not find the part at the expected position range and re-reange for a smaller search before deciding a part is not present or you have an aplication hardware problem.

SearchLStop, diGripperPartOrient2Flanks, pSrchCompl, pSrchEnd, v100, GripperWObj:=wobjA;  
..  
..  
IF ERRNO=ERR\_WHLSEARCH THEN  
WaitTime 1;  
IF (diGripperPartOrient2 = 0) THEN  
**pSrchCompl:=pSrchEnd;**  
RETURN;  
ENDIF  
ENDIF

Hope this helps…

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://tech-community.robotics.abb.com/u/philhoward)\
**Post date:** [June 21, 2010, 12:38pm UTC](https://tech-community.robotics.abb.com/t/searchl-recovery/3595/6 "2010-06-21T12:38:01Z")

</div>

After some experimenting, the way that worked (jumping back from the Error handler routine to the next step in the main program) was to use the TRYNEXT command:  
IF ERRNO=ERR\_WHLSEARCH THEN  
WaitTime 1;  
IF (diGripperPartOrient2 = 0) THEN  
**pSrchCompl:=pSrchEnd;**  
TRYNEXT;  
ENDIF  
ENDIF

Works a treat! Thanks for the suggestions.
