# RTDE Command returns integer

**URL:** <https://forum.universal-robots.com/t/rtde-command-returns-integer/22082>\
**Category:** URScript\
**Created:** [June 20, 2022, 10:10am UTC](https://forum.universal-robots.com/t/rtde-command-returns-integer/22082 "2022-06-20T10:10:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorgigedaminski](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@giorgigedaminski](https://forum.universal-robots.com/u/giorgigedaminski)\
**Post date:** [June 20, 2022, 10:10am UTC](https://forum.universal-robots.com/t/rtde-command-returns-integer/22082/1 "2022-06-20T10:10:07Z")

</div>

Hi Guys,  
I am beginner in UR and socket programming. I am trying to remotely control UR using primary interface and RTDE. I manager to figure out primary interface but have problem with RTDE.

When I send some command with socket it always returns integer value instead of coordinates or boolean. For example:  
get\_actual\_tcp\_pose() ---- Should return the current actual TCP vector [X, Y, Z, Rx, Ry, Rz], but it returns integer \>\>\> 21

The same with digital input command:  
get\_standart\_digital\_in(1) returns integer \>\>\> 26.

Does anybody has an idea how to solve this problem?  
Thanks in advance.  
Giorgi

The script looks like this:

import socket

class RobotConnection:  
def init(self, IP, PORT):  
self.IP = IP  
self.PORT = PORT  
self.s = socket.socket(socket.AF\_INET, socket.SOCK\_STREAM)

```
def connect(self):
    self.s.connect((self.IP, self.PORT))
    print('connected successfully')

```

class RTDE(RobotConnection):  
def init(self, IP, PORT):  
super().init(self, IP, PORT)

```
def get_tcp_pose(self):
    tcp = self.s.send('get_actual_TCP_pose()'.encode())
    return(tcp)

```

if name == ‘main’:  
rtde = RTDE(‘’, 30004)  
rtde.connect()  
print(rtde.get\_tcp\_pose())

> > 21

---

<div class="post-metadata">

**Author:** ![giorgigedaminski](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@giorgigedaminski](https://forum.universal-robots.com/u/giorgigedaminski)\
**Post date:** [July 1, 2022, 8:29am UTC](https://forum.universal-robots.com/t/rtde-command-returns-integer/22082/2 "2022-07-01T08:29:05Z")

</div>

Any Ideas about this?
