# Set TCP based on Digital Input

**URL:** <https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414>\
**Category:** Technical Questions\
**Tags:** tcp, tool-changer\
**Created:** [January 12, 2021, 12:04pm UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414 "2021-01-12T12:04:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon11618913](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon11618913](https://forum.universal-robots.com/u/anon11618913)\
**Post date:** [January 12, 2021, 12:04pm UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414/1 "2021-01-12T12:04:23Z")

</div>

Hello,  
I have a application where I will need to have a tool change within my program. Is there a way to change the TCP based on a certain DI? I am using DI0 and DI1 for detecting which tool is currently active on my UR. Thanks

---

<div class="post-metadata">

**Author:** ![sam.verity-hilton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sam.verity-hilton/32/6046_2.png) [@sam.verity-hilton](https://forum.universal-robots.com/u/sam.verity-hilton)\
**Post date:** [January 12, 2021, 1:38pm UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414/2 "2021-01-12T13:38:40Z")

</div>

Assuming this is just as part of a regular polyscope program, then I would suggest just using a thread which assesses the state of your inputs and sets the TCP accordingly using a normal set node.

---

<div class="post-metadata">

**Author:** ![terryc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/terryc/32/3006_2.png) [@terryc](https://forum.universal-robots.com/u/terryc)\
**Post date:** [January 14, 2021, 5:57am UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414/3 "2021-01-14T05:57:46Z")

</div>

Agreed with above, although you might need some flag handshaking. Changing the TCP during an active move will probably fault.

---

<div class="post-metadata">

**Author:** ![anon11618913](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon11618913](https://forum.universal-robots.com/u/anon11618913)\
**Post date:** [January 15, 2021, 12:01pm UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414/4 "2021-01-15T12:01:08Z")

</div>

Thanks for the replys.

@sam.verity-hilton Thats what i thought, but i always have issues with threads, i will try again.

@terryc It wouldnt be during an active move, i have an automatic tool changer on my setup so i will be able to insert a wait command to avoid this. But thanks for the information!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/system/32/1_2.png) [@system](https://forum.universal-robots.com/u/system)\
**Post date:** [January 22, 2021, 7:21pm UTC](https://forum.universal-robots.com/t/set-tcp-based-on-digital-input/11414/5 "2021-01-22T19:21:43Z")

</div>

Closed on January 22, 2021, 7:21pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
