# Predicted collision error handler

**URL:** <https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149>\
**Category:** RAPID Programming\
**Created:** [October 14, 2019, 10:07am UTC](https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149 "2019-10-14T10:07:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![egor](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/egor/32/2735_2.png) [@egor](https://tech-community.robotics.abb.com/u/egor)\
**Post date:** [October 14, 2019, 10:07am UTC](https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149/1 "2019-10-14T10:07:15Z")

</div>

I want the robot to go back if the “ **50431: Predicted Collision** ” error is triggered (not confuse with Motion Supervision error).  
But I can’t catch this error by standart method via ERROR handler. I tried to use **IError** command and TRAP routine at the semistatic TASK,  
but Rob\_1 task cause an error before TRAP routine works.The system parameter Controller/General Rapid/CollisionErrorHandling is set to YES.  
“ERRNO=ERR\_COLL\_STOP” not working too.

Station in attachment.

ROB\_1 TASK:

PROC main()  
MoveL Target\_10,v100,fine,tool0;  
!Collision here  
MoveL Target\_20,v100,fine,tool0;  
MoveL Target\_10,v100,fine,tool0;  
ERROR  
IF ERRNO=431 THEN  
TPWrite “error detected”;  
ENDIF  
ENDPROC

SEMISTATIC TASK:

MODULE gapMain

VAR intnum CollisionInt;  
VAR intnum err\_interrupt;  
VAR trapdata err\_data;  
VAR errdomain err\_domain:=5;  
VAR num err\_number;  
VAR errtype err\_type;

PROC main()

WHILE TRUE DO  
IDelete CollisionInt;  
CONNECT CollisionInt WITH CollisionTrap;  
IError MOTION\_ERR\ErrorId:=431,TYPE\_ERR,CollisionInt;  
WaitTime 0.1;  
ENDWHILE  
ENDPROC

TRAP CollisionTrap  
GetTrapData err\_data;  
ReadErrData err\_data,err\_domain,err\_number,err\_type;

TPWrite “Collision detected”;  
ENDTRAP  
ENDMODULE  
[CollisionAvoid.rar](https://tech-community.robotics.abb.com/uploads/short-url/gXgQdBsvIGa3d3KdYwwQHIGLEeo.rar) (68.5 KB)

---

<div class="post-metadata">

**Author:** ![Johannes\_Weiman](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@Johannes\_Weiman](https://tech-community.robotics.abb.com/u/Johannes_Weiman)\
**Post date:** [October 14, 2019, 2:17pm UTC](https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149/2 "2019-10-14T14:17:30Z")

</div>

I think ERR\_COLL\_STOP is only for actual collisions. I will check around if there is an equivalent for predicted collisions.

---

<div class="post-metadata">

**Author:** ![Johannes\_Weiman](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@Johannes\_Weiman](https://tech-community.robotics.abb.com/u/Johannes_Weiman)\
**Post date:** [October 14, 2019, 2:41pm UTC](https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149/3 "2019-10-14T14:41:37Z")

</div>

Error handling for predicted collisions is not supported. It is in the backlog but not planned for a specific release at the moment.

---

<div class="post-metadata">

**Author:** ![SWoollett](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@SWoollett](https://tech-community.robotics.abb.com/u/SWoollett)\
**Post date:** [July 31, 2022, 7:50pm UTC](https://tech-community.robotics.abb.com/t/predicted-collision-error-handler/9149/4 "2022-07-31T19:50:36Z")

</div>

Hi, Is there an update for this?
