# RealTime client Robot Mode

**URL:** <https://forum.universal-robots.com/t/realtime-client-robot-mode/1852>\
**Category:** Robot Communication\
**Created:** [April 9, 2018, 7:49am UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852 "2018-04-09T07:49:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon83012695](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@anon83012695](https://forum.universal-robots.com/u/anon83012695)\
**Post date:** [April 9, 2018, 7:49am UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/1 "2018-04-09T07:49:12Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![anon42905246](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon42905246](https://forum.universal-robots.com/u/anon42905246)\
**Post date:** [April 9, 2018, 10:34am UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/2 "2018-04-09T10:34:05Z")

</div>

I guess somebody should look under

> PolyScopeProgramServer on the “How to” Page

as it says in Realtime Pre-3.0.

---

<div class="post-metadata">

**Author:** ![anon83012695](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@anon83012695](https://forum.universal-robots.com/u/anon83012695)\
**Post date:** [April 9, 2018, 11:39am UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/3 "2018-04-09T11:39:18Z")

</div>

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=](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?

---

<div class="post-metadata">

**Author:** ![anon42905246](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon42905246](https://forum.universal-robots.com/u/anon42905246)\
**Post date:** [April 9, 2018, 12:09pm UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/4 "2018-04-09T12:09:00Z")

</div>

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/](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/)

---

<div class="post-metadata">

**Author:** ![anon83012695](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@anon83012695](https://forum.universal-robots.com/u/anon83012695)\
**Post date:** [April 9, 2018, 12:27pm UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/5 "2018-04-09T12:27:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [April 15, 2018, 5:48pm UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/6 "2018-04-15T17:48:52Z")

</div>

Hi @anon83012695,

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]
```

---

<div class="post-metadata">

**Author:** ![anon94763411](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@anon94763411](https://forum.universal-robots.com/u/anon94763411)\
**Post date:** [April 16, 2018, 8:15am UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/7 "2018-04-16T08:15:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [April 16, 2018, 12:01pm UTC](https://forum.universal-robots.com/t/realtime-client-robot-mode/1852/8 "2018-04-16T12:01:17Z")

</div>

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/](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/)
