# Implementation of RTDE into C#

**URL:** <https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661>\
**Category:** Robot Communication\
**Created:** [July 3, 2019, 1:44pm UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661 "2019-07-03T13:44:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon482214](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon482214](https://forum.universal-robots.com/u/anon482214)\
**Post date:** [July 3, 2019, 1:44pm UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/1 "2019-07-03T13:44:36Z")

</div>

Hello,  
I am working on a programm were i need the current coordinates of the tool (x,y,z,xr,yr,zr).  
As recommended I am trying to use RTDE also because the Robot-Programm should not be touched.  
Sice i want he current coordinates i want, as described on the RTDE guide, “actual\_TCP\_pose”. Can someone help with that topic.

The part of the code i have trouble with is:

```
                byte[] sbuffer = new byte[1024];
                byte[] buffer = new byte[1024];
                
                sbuffer = Encoding.UTF8.GetBytes("actual_TCP_pose");
                s.Send(sbuffer);
                s.Receive(buffer);
                txt = Encoding.ASCII.GetString(buffer);
                s.Close();

```

For Explenation:  
s = my socket --\> Connection is Working. I am using Port 30004 (the RTDE port).  
sbuffer = my "Send-Buffer  
buffer = recieve Buffer  
txt = string with is suposed to contain the Coordinates

Thanks for Help

---

<div class="post-metadata">

**Author:** ![frederic.chaxel](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@frederic.chaxel](https://forum.universal-robots.com/u/frederic.chaxel)\
**Post date:** [July 4, 2019, 3:55am UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/2 "2019-07-04T03:55:17Z")

</div>

Hi,

.NET library done here:

[https://sourceforge.net/p/firsttestfchaxel/code/HEAD/tree/trunk/Ur\_Rtde/](https://sourceforge.net/p/firsttestfchaxel/code/HEAD/tree/trunk/Ur_Rtde/)

Gets back only the fields your want (all or a part of), you just have to define two class with the RTDE fields requested.

Bye.

---

<div class="post-metadata">

**Author:** ![anon84262953](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@anon84262953](https://forum.universal-robots.com/u/anon84262953)\
**Post date:** [July 9, 2019, 12:26am UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/3 "2019-07-09T00:26:33Z")

</div>

Tried using your code and it always fails on Ur\_ControlStart. Why might this be happening?

---

<div class="post-metadata">

**Author:** ![frederic.chaxel](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@frederic.chaxel](https://forum.universal-robots.com/u/frederic.chaxel)\
**Post date:** [July 9, 2019, 4:00am UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/4 "2019-07-09T04:00:35Z")

</div>

Hi,

Yes … the code was not up to date (a small bug inside).

Now it’s OK, get back it on Sourceforge.

Bye.

---

<div class="post-metadata">

**Author:** ![anon84262953](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@anon84262953](https://forum.universal-robots.com/u/anon84262953)\
**Post date:** [July 9, 2019, 7:12pm UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/5 "2019-07-09T19:12:59Z")

</div>

Is there an existing command in your implementation to send a command to move the robot to a position using the six axis values? I am looking through and trying to find a send command that allows input of a six double long array.

---

<div class="post-metadata">

**Author:** ![frederic.chaxel](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@frederic.chaxel](https://forum.universal-robots.com/u/frederic.chaxel)\
**Post date:** [July 10, 2019, 3:41am UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/6 "2019-07-10T03:41:06Z")

</div>

adds for instance

public double input\_double\_register\_24;  
public double input\_double\_register\_25;

and so on in UniversalRobot\_Inputs class.

---

<div class="post-metadata">

**Author:** ![androidflorent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/androidflorent/32/3314_2.png) [@androidflorent](https://forum.universal-robots.com/u/androidflorent)\
**Post date:** [March 22, 2022, 7:13pm UTC](https://forum.universal-robots.com/t/implementation-of-rtde-into-c/4661/7 "2022-03-22T19:13:20Z")

</div>

See also this [.NET C# RTDE implementation](https://underautomation.com/universal-robots)
