# Control URxe over TCP/IP ethernet

**URL:** <https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437>\
**Category:** Technical Questions\
**Created:** [May 16, 2023, 2:35pm UTC](https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437 "2023-05-16T14:35:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon23111962](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon23111962](https://forum.universal-robots.com/u/anon23111962)\
**Post date:** [May 16, 2023, 2:35pm UTC](https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437/1 "2023-05-16T14:35:05Z")

</div>

Hi all,

Beginner question - I’m getting started controlling a UR3e and trying to get my head round remote control.

My application needs the robot to go many to on-the-fly software defined positions and use digital I/O. Using URScript alone is not enough as data needs to be exchanged with other PC software.  
I would like to control the robot from PC software, preferably python3. I don’t need full real time control, the UR can do its own trajectory control etc.

I have consulted the Overview of Client Interfaces and linked pages [Overview of client interfaces - 21744](https://www.universal-robots.com/articles/ur/interface-communication/overview-of-client-interfaces/)  
and the Remote Operation Guide: [https://s3-eu-west-1.amazonaws.com/ur-support-site/123978/Remote%20Operation%20Guide%20V1.1.pdf](https://s3-eu-west-1.amazonaws.com/ur-support-site/123978/Remote%20Operation%20Guide%20V1.1.pdf)

I don’t think Daskboard mode is appropriate as I’m not looking to start/stop programs but create and parse them one line at a time. XML-RPC and the ethernet examples given seem to be only parsing coordinates but cannot use I/O etc.

Socket seems to be the way to go and it’s close to behaving.  
I have enabled EtherNet/IP in Installation/Fieldbus enabled and switched to Remote Control and set a fixed IP address in settings. A short python script that opens a socket and sends strings such as "movel(p[300,0,100,3.1416,0,0]) " or “set\_digital\_out(4,False)” works - the robot obeys without any program loaded.

However, data transfer is one way only. I have attempted to listen to the robot with sock.recv(1024).decode(‘utf-8’) or ascii but the result rarely decodes sucessfully. All I can decipher is “URControl” and the build date in the first message after connecting.  
Hence, my software has no indication of when the robot is busy/moving. If another command is sent before the first is complete, the earlier command is abandoned and the robot immediately begins moving to the new target. At the very least I need the robot to complete each command before moving to the next - some kind of “state=idle” message back from the robot would be ideal.

Any suggestions on how to receive/decode status messages from the robot?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![pho](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/pho/32/2275_2.png) [@pho](https://forum.universal-robots.com/u/pho)\
**Post date:** [May 16, 2023, 5:38pm UTC](https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437/2 "2023-05-16T17:38:09Z")

</div>

It seems you might want to use Interpreter Mode. [Universal Robots - Interpreter mode](https://www.universal-robots.com/articles/ur/programming/interpreter-mode/)

OR perhaps RTDE [Real-Time Data Exchange (RTDE) Guide - 22229](https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/)

Both have examples in the Remote Operation Guide

---

<div class="post-metadata">

**Author:** ![anon23111962](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon23111962](https://forum.universal-robots.com/u/anon23111962)\
**Post date:** [May 17, 2023, 2:39pm UTC](https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437/3 "2023-05-17T14:39:00Z")

</div>

Thanks pho!

Interpreter Mode is certainly what I was looking for, thanks for highlighting it. It’s odd that IM is not mentioned on [Overview of client interfaces - 21744](https://www.universal-robots.com/articles/ur/interface-communication/overview-of-client-interfaces/) nor [Remote Control Via TCP/IP - 16496](https://www.universal-robots.com/articles/ur/interface-communication/remote-control-via-tcpip/)

By changing the port from 30001 to 30020 and running the one-liner URScript interpreter\_mode() in Local Control, commands are queued and executed sequentially. Great to have the choice of policy. By taking inspiration from UR’s interpreter.py in interpreter\_examples in the footer of of your first link, I can poll the number of uploaded but unexecuted commands and hence choose to wait until this = 0 before sending more.

Sorted, thank you!

I also tested the same readuntil(‘\n’) style listening on what the robot was sending on the Primary port 30001, but it was still garbled, mostly non alphanumeric characters.

---

<div class="post-metadata">

**Author:** ![anon91490535](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon91490535](https://forum.universal-robots.com/u/anon91490535)\
**Post date:** [May 23, 2023, 1:26pm UTC](https://forum.universal-robots.com/t/control-urxe-over-tcp-ip-ethernet/28437/4 "2023-05-23T13:26:52Z")

</div>

Honestly I am allergic to UR Script, and the interpreter mode seems to be a patch to just a bad scripting language to make it work from a computer.

If that is of any help, here is a Python package developed by the University of Southern Denmark and that allows for native Python control over RTDE, without executing a script on the teach pendant: [Introduction — ur\_rtde 1.5.6 documentation](https://sdurobotics.gitlab.io/ur_rtde/introduction/introduction.html)

At least you don’t have to write the wrapper yourself!
