# Get TCP speed while program is running?

**URL:** <https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716>\
**Category:** Technical Questions\
**Created:** [October 31, 2022, 8:47am UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716 "2022-10-31T08:47:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vt340](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vt340](https://forum.universal-robots.com/u/vt340)\
**Post date:** [October 31, 2022, 8:47am UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716/1 "2022-10-31T08:47:45Z")

</div>

Hello!

What is the best way to get the TCP speed with Python while a URP program is running?  
I know how to do a UR-Script sending stuff via TCP but as far as I know I cannot run an URP program and UR script at the same time??!

What would be the best solution?

---

<div class="post-metadata">

**Author:** ![anon34306213](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anon34306213](https://forum.universal-robots.com/u/anon34306213)\
**Post date:** [October 31, 2022, 11:47am UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716/2 "2022-10-31T11:47:44Z")

</div>

The Python Real Time Data Exchange (RTDE) will allow you to constantly exchange any available information from the robot:  
[https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/](https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/)

And on github:

> **[GitHub - UniversalRobots/RTDE\_Python\_Client\_Library: RTDE client library and...](https://github.com/UniversalRobots/RTDE_Python_Client_Library)**
>
> RTDE client library and examples. Contribute to UniversalRobots/RTDE\_Python\_Client\_Library development by creating an account on GitHub.

**actual\_TCP\_speed** is a VECTOR6D type of data which corresponds to:

- x\_axis speed in m/s
- y\_axis speed in m/s
- z\_axis speed in m/s
- x\_rotational speed in rad/s
- y\_rotational speed in rad/s
- z\_rotational speed in rad/s

And you can manipulate it like you would do with any list.

Hope it helped 🙂

---

<div class="post-metadata">

**Author:** ![vt340](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vt340](https://forum.universal-robots.com/u/vt340)\
**Post date:** [October 31, 2022, 4:17pm UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716/3 "2022-10-31T16:17:24Z")

</div>

Cool than you but is this libary also working with old CB2 and Polyscope 1.8 ?

---

<div class="post-metadata">

**Author:** ![anon34306213](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anon34306213](https://forum.universal-robots.com/u/anon34306213)\
**Post date:** [November 2, 2022, 7:06am UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716/4 "2022-11-02T07:06:33Z")

</div>

I think it will only work on the newer e-Series.  
☹

---

<div class="post-metadata">

**Author:** ![vt340](https://avatars.discourse-cdn.com/v4/letter/v/f0a364/32.png) [@vt340](https://forum.universal-robots.com/u/vt340)\
**Post date:** [November 2, 2022, 10:49pm UTC](https://forum.universal-robots.com/t/get-tcp-speed-while-program-is-running/24716/5 "2022-11-02T22:49:52Z")

</div>

I just added a thread into the program sending the TCP speed via socket to the raspberry pi. Works fine!
