# How to write error Handling with GoFa Collision

**URL:** <https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767>\
**Category:** RAPID Programming\
**Created:** [June 13, 2022, 8:49am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767 "2022-06-13T08:49:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robero](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Robero](https://tech-community.robotics.abb.com/u/Robero)\
**Post date:** [June 13, 2022, 8:49am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767/1 "2022-06-13T08:49:26Z")

</div>

Hi everyone,

I am trying to write a error handling from a collision on our GoFa but I can´t get it to work.  
I uploaded a screenshot of my code. To test it there is just two positions going back and forward, to try it out and make it easy.  
Buy my error handler does not react and nothing happens after the error.  
What am I doing wrong?

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/e443cd7e13664995babfd3b12d6cd908f54cf3f1.png)  
 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/1/1b374082b672cbc19c98238c97b7bb4089b10277.png)

---

<div class="post-metadata">

**Author:** ![Forge\_Engineering](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/forge_engineering/32/4455_2.png) [@Forge\_Engineering](https://tech-community.robotics.abb.com/u/Forge_Engineering)\
**Post date:** [June 15, 2022, 3:38am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767/2 "2022-06-15T03:38:27Z")

</div>

Hi Robero,

Is CollisionErrorHandling set to “Yes” in your controller configuration under General Rapid:

 ![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/6a5f7845c62da95702722638f744b2e05cde6bae.png)

If it is set to No, the program will just stop. If it is set to Yes, the robot will still halt motion but the program will continue into the error handler.

Regards,

Harry

---

<div class="post-metadata">

**Author:** ![graemepaulin](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@graemepaulin](https://tech-community.robotics.abb.com/u/graemepaulin)\
**Post date:** [June 15, 2022, 4:07am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767/3 "2022-06-15T04:07:06Z")

</div>

Also the errno is not a number but the “pre defined text equivalent” - you can find the list in the manual RAPID Instructions, Functions and Data types.  
In this case probably ERR\_COLL\_STOP.

---

<div class="post-metadata">

**Author:** ![Robero](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Robero](https://tech-community.robotics.abb.com/u/Robero)\
**Post date:** [June 15, 2022, 6:25am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767/4 "2022-06-15T06:25:07Z")

</div>

So many thanks guys! It works with ERR\_COLL\_STOP. Is there any way to handle the errors like that in the screenshot? In this example Error 50204 ''motion supervised. Can you write error handling for those kind of errors?

---

<div class="post-metadata">

**Author:** ![graemepaulin](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@graemepaulin](https://tech-community.robotics.abb.com/u/graemepaulin)\
**Post date:** [June 15, 2022, 8:52am UTC](https://tech-community.robotics.abb.com/t/how-to-write-error-handling-with-gofa-collision/10767/5 "2022-06-15T08:52:52Z")

</div>

From the RAPID Kernal manual:

The RAPID execution does not have to stop when a collision error occurs (event number 50204 - Motion supervision). If the system parameter Collision Error Handler is defined the execution will enter the RAPID error handler after the retraction and the execution can continue if all conditions for further execution are fulfilled.

To be able to start the motion after leaving the error handler, a StartMove instruction must be called from the error handler.
