# I control ur5e through socket. Where is the current TCP coordinate of the robot and the hand grip closing width of the robot?

**URL:** <https://forum.universal-robots.com/t/i-control-ur5e-through-socket-where-is-the-current-tcp-coordinate-of-the-robot-and-the-hand-grip-closing-width-of-the-robot/18391>\
**Category:** Technical Questions\
**Created:** [December 30, 2021, 1:43am UTC](https://forum.universal-robots.com/t/i-control-ur5e-through-socket-where-is-the-current-tcp-coordinate-of-the-robot-and-the-hand-grip-closing-width-of-the-robot/18391 "2021-12-30T01:43:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon62377786](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon62377786](https://forum.universal-robots.com/u/anon62377786)\
**Post date:** [December 30, 2021, 1:43am UTC](https://forum.universal-robots.com/t/i-control-ur5e-through-socket-where-is-the-current-tcp-coordinate-of-the-robot-and-the-hand-grip-closing-width-of-the-robot/18391/1 "2021-12-30T01:43:56Z")

</div>

I control ur5e through socket. Where is the current TCP coordinate of the robot and the hand grip closing width of the robot?

self.tcp\_socket = socket.socket(socket.AF\_INET, socket.SOCK\_STREAM)  
self.tcp\_socket.connect((self.tcp\_host\_ip, self.tcp\_port))  
state\_data = self.tcp\_socket.recv(2048)

Like this, state\_ Which section of the data returned by data is the current TCP coordinate and which section is the joint coordinate?

My ur version is 5.10

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [January 5, 2022, 2:17am UTC](https://forum.universal-robots.com/t/i-control-ur5e-through-socket-where-is-the-current-tcp-coordinate-of-the-robot-and-the-hand-grip-closing-width-of-the-robot/18391/2 "2022-01-05T02:17:55Z")

</div>

You can read the robot position, and access other variables through the Real Time Data Exchange, check out the python examples at the bottom of this article:

[https://www.universal-robots.cn/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/](https://www.universal-robots.cn/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/)

---

<div class="post-metadata">

**Author:** ![anon62377786](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon62377786](https://forum.universal-robots.com/u/anon62377786)\
**Post date:** [January 8, 2022, 2:42am UTC](https://forum.universal-robots.com/t/i-control-ur5e-through-socket-where-is-the-current-tcp-coordinate-of-the-robot-and-the-hand-grip-closing-width-of-the-robot/18391/3 "2022-01-08T02:42:53Z")

</div>

Thank you.  
But according to the work requirements, how can I get this information through socket?
