I would like to learn how to use the RTDE protocol. I am currently using an eSeries robot.
I know how to use primary & secondary interface and real time. I know that the best / most optimal solution is to use RTDE.
I have read a little about this interface but I can not quite understand it.
The second problem is that I would like to connect the UR eSeries robot via RTDE with the LABVIEW environment on my computer.
What I am doing:
- Connect to port 30004.
- Then I send a string (using the big-endian form), for example:
- Then I go on to the continuous reading of information that should come via RTDE from the robot to my application.
Unfortunately, all the time I get the information: jM Parse Error: package type is not supported or package invalid, package type: data: <? Xml version = “1.0”
Is there anything else he should do to read the timestamp correctly?
Maybe someone has already worked with RTDE and LabVIEW?
Thanks in advance for time and help!
Can anyone have similar feedback from RTDE?
Or if someone is able to provide some other important information that should be kept in mind when using RTDE communication?
RTDE uses binary protocol. Recipe files, are read by python examples, and used for constructing binary messages sent to controller.
Example sequence would be:
RTDE_REQUEST_PROTOCOL_VERSION - request controller to use latest protocol version (2 is latest at this moment)
RTDE_CONTROL_PACKAGE_SETUP_OUTPUTS - output variables that you need
RTDE_CONTROL_PACKAGE_START - request controller to start sending data
poll socket for data packets continuously
RTDE_CONTROL_PACKAGE_PAUSE - let controller know that you’re about to terminate your program
To get better overview, you can look into python RTDE client library, or use protocol sniffer (wireshark, etc…).
Thank you for your response.
As soon as I have the opportunity I will test what you have suggested and I will write what I managed to achieve in this topic
Hi, I was just wondering what your findings were.
I’ve also been working to get something working in LabVIEW with RTDE and had some trouble getting things started. I ended up digging through the python code and using wireshark to see exactly what is being sent and it turns out it has nothing to do with xml. That is just the way that the python example stores the information of what variable it wants. I found it easier to follow the protocol outlined here: https://www.universal-robots.com/articles/ur/real-time-data-exchange-rtde-guide/
I’ve attached a VI that I use in order to format command to configure outputs. The resulting string is what you would send over TCP to the RTDE interface. If we were trying to setup the RTDE in the same way as Mirosalv, we want to configure the RTDE output to give us the timestamp. The first thing we need to do is determine the package type according the the protocol I linked above. Around the middle of the page it says that the package type to configure an output is 79 (in U8 representation). To configure the outputs you have to send an update frequency in hertz (a double typecast to HEX) and a comma separated list of the variables you want returned using the exact naming shown in that link.
So if you wanted to know the timestamp and target joint positions at a rate of 125 Hz, you’d wire 79 into the command ID input, 125 into the Output Freq. input and an array containing “timestamp” and “target_q” as the requested outputs. It’ll convert the command ID and frequency into Hex, format the array into the comma separated list and then prepend the packet size (represented as a U16 in hex) to the front of that. Note that it adds 2 to the size because the packet size includes the bytes used to indicate the size. The defaults in the VI would configure the RTDE to return essentially all of the possible variables.
Hope this wasn’t too unclear and good luck!
RTDE command example.zip (9.8 KB)