# How to receive messages from a UR10 URScript?

I've been looking at existing this UR TCP/IP communication protocol answer, the data linked but I'm still a little confused to how I could retrieve values from calculations, for example get_inverse_kin()

I've tried to figure it out based on the available articles on the Universal Robots support site, but even that has a usage guide: "How to use this Support site" :)

I can receive the Realtime data and parse it based on the Client_Interface.xlsx specifications, but that does not include calculations done via the motion module.

The other thing I have in mind is writing a URScript along these lines:

1. store the result of the get_inverse_kin() in a float[] (e.g. angles = get_inverse_kin(pose_here)
2. make a string representation of the data (e.g. str = "{\"angles:\":[0,1,2,3,4,5]}")
3. open a socket to the computer to send the data (e.g. socket_open("COMPUTER_IP_HERE", 50000, "motion_results")
4. Send the angles string (e.g. socket_send_line(str, "motion_results"))

This feels a bit long-winded though. Is how values should be sent ?

What is the most efficient way of receiving URScript motion module results on a computer connected to the Control Box ?

• I don't understand the question. You start out linking a post about TCP/IP communication, but then ask how to get a value from a built-in function. What does TCP/IP have to do with this? Can you not just call something like joint_values = get_inverse_kin();? From the manual (direct PDF link) it looks like there are inputs you need to provide (top of page 22), but otherwise what is the problem you're having? What code are you using to try to perform the calculation? May 16 '17 at 18:49
• @Chuck What I would like to do is call functions listed in the manual, but from my own computer. I can send URScript strings via a TCP socket talking to the UR10, but I can't figure out how to simply read the results back. I can read the feedback data, but not results to the functions I call on the UR10 triggered from the network. Sorry if this is confusing, would be more than happy to explain. May 16 '17 at 19:08