# Simulating collision error and recovery in RobotStudio

**URL:** <https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921>\
**Category:** RobotStudio\
**Created:** [January 21, 2014, 2:28pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921 "2014-01-21T14:28:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pacijent](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/pacijent/32/512_2.png) [@pacijent](https://tech-community.robotics.abb.com/u/pacijent)\
**Post date:** [January 21, 2014, 2:28pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/1 "2014-01-21T14:28:03Z")

</div>

Hello to all, I would like to simulate collision error and recovery possibility in RS. We have robot system with multitasking option. I tried to do recovery inside semistatic task, without success. So my question is where should be trap routine (main, robot motion, or semistatic task), and where should be recovery routine (motion up after collision). And how to raise collision error in rapid (I guess inside robot motion routine?). Thanks in advance.

---

<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:** [February 3, 2014, 9:44am UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/2 "2014-02-03T09:44:10Z")

</div>

Hi,  
I did this once with a S4 system where I used a semistatic task.In this task I used the instruction “IError” to trig a trap routine when a collision had occured.  
In the trap routine I used system signals to reset the error, turn on the motors and restart the program. This worked fine in the real robot.

---

<div class="post-metadata">

**Author:** ![pacijent](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/pacijent/32/512_2.png) [@pacijent](https://tech-community.robotics.abb.com/u/pacijent)\
**Post date:** [February 6, 2014, 12:40pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/3 "2014-02-06T12:40:51Z")

</div>

Thanks a lot for the answer Anders.

---

<div class="post-metadata">

**Author:** ![bran21](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@bran21](https://tech-community.robotics.abb.com/u/bran21)\
**Post date:** [June 23, 2026, 12:53pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/4 "2026-06-23T12:53:42Z")

</div>

> [@Anders\_S](#):
>
> I used the instruction “IError” to trig a trap routine when a collision had occured.  
> In the trap routine I used system signals to reset the error, turn on the motors and restart the program. This worked fine in the real robot.

Would you by chance have a code snippet of this? I’d love to see your trap routine! I am struggling with finding an example for this very same recovery setup!

---

<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:** [June 23, 2026, 3:01pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/5 "2026-06-23T15:01:20Z")

</div>

I’m afraid not, it was over 20 years agoo I did this on a S4 system, so that code is gone 😉 .

---

<div class="post-metadata">

**Author:** ![bran21](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@bran21](https://tech-community.robotics.abb.com/u/bran21)\
**Post date:** [June 23, 2026, 3:36pm UTC](https://tech-community.robotics.abb.com/t/simulating-collision-error-and-recovery-in-robotstudio/5921/6 "2026-06-23T15:36:37Z")

</div>

Oops I just noticed the date! Totally understandable!! I appreciate you responding!
