Control URxe over TCP/IP ethernet

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
and the Remote Operation Guide:

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!

It seems you might want to use Interpreter Mode. Universal Robots - Interpreter mode

OR perhaps RTDE Real-Time Data Exchange (RTDE) Guide - 22229

Both have examples in the Remote Operation Guide

1 Like

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 nor Remote Control Via TCP/IP - 16496

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 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.

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

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