# Recieving and processing URScript data from secondary interface

**URL:** <https://forum.universal-robots.com/t/recieving-and-processing-urscript-data-from-secondary-interface/19623>\
**Category:** Robot Communication\
**Created:** [March 3, 2022, 6:46am UTC](https://forum.universal-robots.com/t/recieving-and-processing-urscript-data-from-secondary-interface/19623 "2022-03-03T06:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anderson.bpt13](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anderson.bpt13](https://forum.universal-robots.com/u/anderson.bpt13)\
**Post date:** [March 3, 2022, 6:46am UTC](https://forum.universal-robots.com/t/recieving-and-processing-urscript-data-from-secondary-interface/19623/1 "2022-03-03T06:46:07Z")

</div>

Hello everyone, I seriously hope you all can help me because this has been driving me up the wall.

I’m writing code to try to control a UR3e, 5.11 version software. What I want to do is have the robot move and rotate using the local coordinate system of the TCP. I’ve been referring back [this thread](https://forum.universal-robots.com/t/speedl-in-tool-frame/7590) on how to go about doing this using some of the methods in the URScript programming language.

Herein lies my problem. How can I get data output by URScript methods from the control board back to the computer running the script?

The control code is written in python and runs on a computer that is connected to the robot via TCP/IP and uses the secondary interface (port 30002). I’ve been using conversation in [this thread](https://forum.universal-robots.com/t/decode-return-value/18631) and [this other thread](see comment) to figure out how to parse data coming back from the robot, and I’m getting nowhere. I have pored over the spreadsheet linked to in the Remote Control via TCP/IP (the website won’t let me use a link) slides, as well as poring over the PDF guide of the URScript API.

All I want to do is send a method call over some sort of ethernet connection, and get the returned data back in a way that is meaningful. I have written code that transmits certain URScript method calls to the robot and listens/parses the data that comes back, but there is some data that isn’t described in the excel file.

I have seen people say numerous times that RTDE is the way to do good communication with these robots, and I am open to trying it, but I also have not seen an example of my exact use case being executed with RTDE. It seems to me as if RTDE gives you very quick realtime access to up to 255 pieces of data about the robot that you can assign to “recipes” depending on your needs. This is excellent but it is not helpful to my case, where I need URScript functions to be run on the machine and the data it parses to be sent back to me.

I know I can use the URScript API to call functions remotely, as I’ve been using speedl and movel frequently and succesfully to control the robot, but I’ve yet to have success getting data back.

Someone please help me, I have been banging my head against this project for months and I’m not getting any closer.

---

<div class="post-metadata">

**Author:** ![anderson.bpt13](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anderson.bpt13](https://forum.universal-robots.com/u/anderson.bpt13)\
**Post date:** [March 3, 2022, 8:14pm UTC](https://forum.universal-robots.com/t/recieving-and-processing-urscript-data-from-secondary-interface/19623/2 "2022-03-03T20:14:39Z")

</div>

> [@How to process package from robot controller](https://forum.universal-robots.com/t/how-to-process-package-from-robot-controller/390):
>
> Hi, I am using SocketTest3 to connect to robot controller and I receive these output/package from robot controller. can someone tell how to process these data/package from port 30001,30002,30003 and 30004 I have a hard time try to understand [Real-Time Data Exchange (RTDE) Guide - 22229](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/) would be a great help if someone could explain to me thanks these are what i get from each port [image] [image] [image] [image]

This is the third link I point to in my post, alas UR doesn’t let new users post more than two links for some reason.
