# Handling data sent over TCP/IP

**URL:** <https://forum.universal-robots.com/t/handling-data-sent-over-tcp-ip/25330>\
**Category:** Robot Communication\
**Created:** [November 29, 2022, 9:44am UTC](https://forum.universal-robots.com/t/handling-data-sent-over-tcp-ip/25330 "2022-11-29T09:44:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tor/32/1876_2.png) [@tor](https://forum.universal-robots.com/u/tor)\
**Post date:** [November 29, 2022, 9:44am UTC](https://forum.universal-robots.com/t/handling-data-sent-over-tcp-ip/25330/1 "2022-11-29T09:44:12Z")

</div>

Hi,  
I’m going to communicate with a medical device with TCP/IP using a UR3e, and will recieve the response in:

_ **"XML fragments sent using the ASCII character set. A command consists** _  
_ **of a “command” element followed by a name attribute and one or more parameter attributes:** _

Example:  
\<response command=“AssumeControl” code=“0” message=“Success” /\>

I assume I should use **socket\_read\_ascii\_float();** to recieve the data. I then want to read the “0” to find out if the command was successful. How do I handle the data read in the UR program?

/Tor

---

<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:** [November 29, 2022, 3:32pm UTC](https://forum.universal-robots.com/t/handling-data-sent-over-tcp-ip/25330/2 "2022-11-29T15:32:23Z")

</div>

You’ll probably have to use **socket\_read\_string**

read ascii float requires data to be formatted a specific way:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/c766df2be8a05191ba97b43d3e951ff70f0d94e7.png)

You’ll probably have to use the URScript string parsing functions to seperate out your value. Some combinations of these should do it:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/9af01d3727390f4541aaff72b562bd01864a8312.png)
