RealTime client Robot Mode

Hi!

I’m currently connected to the RealTime client on port 30003 and I’m trying to understand what the Robot Mode repersents in the RealTime interface (https://s3-eu-west-1.amazonaws.com/ur-support-site/16496/Client_Interface_V3.5.xlsx)

It’s an 8byte double, yet I would expect it only to be one byte as “Robot Modes” under DataStreamFromURController states that there are only 9 different robot modes. What am I missing? How do I interpret the 8 byte double?

Thanks!

I guess somebody should look under

PolyScopeProgramServer on the “How to” Page

as it says in Realtime Pre-3.0.

Hi! Thanks for answering.

There is no “How to” page, called this, or am I looking in the wrong place? Can you share a link in that case?
https://www.universal-robots.com/how-tos-and-faqs/how-to/?query=PolyScopeProgramServer&email=

If it’s refering to the dashboard server, I still can’t make sense of it, as robotmode either return an integer or text depending on CB version.

Also I’m using RealTime 3.5, (As far as I know) so would it make any sense to look at pre 3.0?

Probably it does not make sense. However, the data type didn’t change since then, I think it is either copy-paste error or this is an internal note for UR employees.

I noticed, that @ajp is the most familiar with communication interfaces, but last time he posted was over a month ago.

EDIT: btw this website says it is UINT32 and reference rtde client uses this data type.
https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/

Seems resonable.

To make it even more confusing RTDE states that its robot_mode is Int32 and then refers to the excel sheet containing the client interfaces I linked in my first post.

I’ll hope that @ajp logs in!

Hi @erik,

Apologies for the delay, I have been on leave recently.

I can see how this can be confusing as the various interfaces have been updated individually and now provide slightly different formats for the robotmode field.

As you correctly referenced, in the realtime datastream the format of this value adheres to that listed in the DataStreamFromURController in the client interface excel sheet:

0		ROBOT_MODE_DISCONNECTED				
1		ROBOT_MODE_CONFIRM_SAFETY				
2		ROBOT_MODE_BOOTING				
3		ROBOT_MODE_POWER_OFF				
4		ROBOT_MODE_POWER_ON				
5		ROBOT_MODE_IDLE				
6		ROBOT_MODE_BACKDRIVE				
7		ROBOT_MODE_RUNNING				
8		ROBOT_MODE_UPDATING_FIRMWARE				

This value is formatted as a double presumably for simplicity so it can be processed in the same way as the surrounding values, most of which need to be non integer.

It’s easiest to unpack this using the python struct library as we have done with the other client interface examples: here’s a sample:

#!/usr/bin/env python

import socket
import struct

TCP_PORT = 30003
BUFFER_SIZE = 1108
TCP_IP = '127.0.0.1'
	
# Connect to Real Time Client
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
# Receive one package
rcvd = s.recv(BUFFER_SIZE)
s.close()

#unpack an integer and then 138 doubles
data = struct.unpack('!i138d',rcvd)
print "robotmode ", data[95]
1 Like

Hello Erik,

I’m currently working on UR. I want to invoke real time data from UR5. Can you please tell me basic procedure from scratch for RTDE client interface.

I look forward to hear from you

Thanks

Hi Rohan,

RTDE is considerably simpler to get to grips with than the realtime client interface if you start from our Python samples.

Recommend you download the sample zip from the bottom of the following how to guide, familiarise yourself with the Python code and come back with any specific questions.

https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/