# CONNECT TRAP execution error

**URL:** <https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205>\
**Category:** RAPID Programming\
**Tags:** robotstudio, rapid, trap\
**Created:** [May 27, 2021, 2:39pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205 "2021-05-27T14:39:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SelenErsoy](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@SelenErsoy](https://tech-community.robotics.abb.com/u/SelenErsoy)\
**Post date:** [May 27, 2021, 2:39pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/1 "2021-05-27T14:39:14Z")

</div>

**Dear ABB family,**

I am trying to execute a trap/interrupt function and I get fallowing error, see photo below.  
I think i declare de "CONNECT"in wrong place.

Can someone give me a tip how to o it properly?

Thank you a lot.

Selen Ersoy

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

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [May 27, 2021, 2:45pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/2 "2021-05-27T14:45:21Z")

</div>

Like the instruction error says, you cannot use the same variable name to connect with multiple traps. Create a unique variable name for each trap to solve the issue.

---

<div class="post-metadata">

**Author:** ![SelenErsoy](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@SelenErsoy](https://tech-community.robotics.abb.com/u/SelenErsoy)\
**Post date:** [May 27, 2021, 2:51pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/3 "2021-05-27T14:51:31Z")

</div>

@xerim I use already two different variabele intno1 and intno2 with digital signal R\_HOLD, R\_ManualHOLD  
I still doesnt see it.

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [May 27, 2021, 2:56pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/4 "2021-05-27T14:56:39Z")

</div>

I don’t see where those variables are being declared, try setting it up like this

![image.png](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/4/45043010fd9e26f21a61360d0c2768e6b25a1226.png)

---

<div class="post-metadata">

**Author:** ![SelenErsoy](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@SelenErsoy](https://tech-community.robotics.abb.com/u/SelenErsoy)\
**Post date:** [May 27, 2021, 2:59pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/5 "2021-05-27T14:59:54Z")

</div>

I declare those before proc main, under Module, like i declare my other variable.  
So, should i declare thos in my main proic

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

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [May 27, 2021, 5:15pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/6 "2021-05-27T17:15:01Z")

</div>

I think you need to call IDelete on intno1 and intno2 prior to connecting them to the trap

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [May 27, 2021, 5:23pm UTC](https://tech-community.robotics.abb.com/t/connect-trap-execution-error/10205/7 "2021-05-27T17:23:10Z")

</div>

Like this:

IDelete intno1;  
IDelete intno2;  
CONNECT intno1 WITH HOLD;  
CONNECT intno2 WITH ManualHold;  
ISignalDI R\_HOLD,1,intno1;  
ISignalDI R\_ManualHOLD,1,intno2;
