# How to get TCP and payload\_mass in live on the teach with socket connection?

**URL:** <https://forum.universal-robots.com/t/how-to-get-tcp-and-payload-mass-in-live-on-the-teach-with-socket-connection/4501>\
**Category:** Robot Communication\
**Created:** [June 12, 2019, 9:12am UTC](https://forum.universal-robots.com/t/how-to-get-tcp-and-payload-mass-in-live-on-the-teach-with-socket-connection/4501 "2019-06-12T09:12:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![inu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/inu/32/732_2.png) [@inu](https://forum.universal-robots.com/u/inu)\
**Post date:** [June 12, 2019, 6:56pm UTC](https://forum.universal-robots.com/t/how-to-get-tcp-and-payload-mass-in-live-on-the-teach-with-socket-connection/4501/2 "2019-06-12T18:56:00Z")

</div>

You’re correct the payload may be getting set as an active payload, but when you run your program to query with get\_target\_payload() it will pull from the installation file.

I know that the primary and secondary client stream the TCP offsets, so you can parse through the stream as shown here: [How to process package from robot controller - #4 by ajp](https://forum.universal-robots.com/t/how-to-process-package-from-robot-controller/390/4)

Unfortunately there currently isn’t any built in method for reading the active payload as you described.

You can also try setting the payload in a thread on polyscope instead, the thread could get updated from a variables passed in using a RTDE interface, or other external sources. When the payload is set in the same program that is querying the target payload, you will read the active payload.

---

_[View the full topic](https://forum.universal-robots.com/t/how-to-get-tcp-and-payload-mass-in-live-on-the-teach-with-socket-connection/4501)._
