# connect trap

**URL:** <https://tech-community.robotics.abb.com/t/connect-trap/1250>\
**Category:** Robot Controller\
**Created:** [June 8, 2007, 4:25pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250 "2007-06-08T16:25:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_ABB](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Peter\_ABB](https://tech-community.robotics.abb.com/u/Peter_ABB)\
**Post date:** [June 8, 2007, 4:25pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250/1 "2007-06-08T16:25:54Z")

</div>

Hello,

Did anyone have the experience that write the code which connect the interrupt in the event routine PowerOn. as the following code.

VAR intnum intPressRight:=0;  
PROC PowerUp()  
IDelete intPressRight;  
WaitTime 0.5;  
CONNECT intPressRight WITH tPressRight;  
ISignalDI diRightButton, high , intPressRight;  
IWatch intPressRight;  
ENDPROC

in a normal routine it works,but while i set this routine associated to a event routine PowerOn it doesn’t work. What the problem?

---

<div class="post-metadata">

**Author:** ![RussD](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@RussD](https://tech-community.robotics.abb.com/u/RussD)\
**Post date:** [June 8, 2007, 10:24pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250/2 "2007-06-08T22:24:58Z")

</div>

What do you mean it doesn’t work? It doesn’t execute or it fails with an error? BTW, you don’t need IWatch, the interrupt should be enabled by the preceeding code.

What are your parameter settings for calling this routine in PowerOn?

---

<div class="post-metadata">

**Author:** ![Peter\_ABB](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Peter\_ABB](https://tech-community.robotics.abb.com/u/Peter_ABB)\
**Post date:** [June 9, 2007, 4:25pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250/3 "2007-06-09T16:25:19Z")

</div>

RussD,

in sys.cfg:

# 

CAB\_EXEC\_HOOKS:

-Routine “PowerUp” -Shelf “POWER\_ON” -Task “T\_ROB1” -AllTask

It doesn’t execute .because while execute instruction IWatch it will appear error: no trap connected. ( i know Iwatch doesn’t necessary)

I think if connect the trap in the event routine PowerOn. some times if the conditions met the **PP** will start from the trap routine but not in the main rouitne. system may forbid this situation occuring while powerOn restart.

---

<div class="post-metadata">

**Author:** ![RussD](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@RussD](https://tech-community.robotics.abb.com/u/RussD)\
**Post date:** [June 9, 2007, 7:08pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250/4 "2007-06-09T19:08:29Z")

</div>

Is this an IRC5? If so, did you enter the PowerUp parameter entry manually, or through RobotStudio Online?

According to the IRC5 documentation, and as I verified with 5.09 RSO, -Task and -AllTask are mutually exclusive, i.e. you can specify a task name OR you can specify AllTask, but not both. The same rule probably applies to S4 as well, but I haven’t confirmed that.

What happens if you remove -AllTask?

---

<div class="post-metadata">

**Author:** ![Peter\_ABB](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@Peter\_ABB](https://tech-community.robotics.abb.com/u/Peter_ABB)\
**Post date:** [June 11, 2007, 2:55pm UTC](https://tech-community.robotics.abb.com/t/connect-trap/1250/5 "2007-06-11T14:55:39Z")

</div>

Yes, IRC5 **ROBOTWARE\_5.08.0176** entered the parameter entry manually.

after removed -AllTask it doesn’t work too ( tested in a RobStudio virtual controller). i 'll try it again in a true robot.
