# RTDE | Sending INPUT

**URL:** <https://forum.universal-robots.com/t/rtde-sending-input/6328>\
**Category:** Robot Communication\
**Tags:** rtde\
**Created:** [February 12, 2020, 2:39pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328 "2020-02-12T14:39:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon21401016](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anon21401016](https://forum.universal-robots.com/u/anon21401016)\
**Post date:** [February 12, 2020, 2:39pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328/1 "2020-02-12T14:39:12Z")

</div>

Dear Developers,

I am trying to figured out how does the RTDE conection is working. I had no problem to read outputs from server but I am not able to undestand how does the input works. I am not familiar with Python, so the example showed in guide doesn’t help at all.  
I am using PC with Node-Red (Node.js) installed on as external device.  
I am trying to just control a standard outputs.

This are steps, I have done already.

![Flow](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/5/5737efaecb7f5ea3558604822e2defaecd6396e2.png)

1. Send RTDE\_Request\_Protocol\_Version. I received proper message from server.

2. Send RTDE\_SETUP\_INPUTS. Code below.  
 ![Input setup](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/a87b02d26d416fb6bcef8384d1b63877d7c3656a.png)  
Received message contain:  
 ![MessageSetup](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/c383a42876243083552c7fe727b8c51e9ef2d27b.png)

3. Send RTDE\_DATA\_PACKAGE. Code below:

![Input Data Package](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/1/14872734308aef73833c4cd8eec5599db5fbab2e.png)

I haven’t any response from server(what is correct basing on guide).  
But unfortunetly digital output DO0 did not turn on.

I was trying also to send START commend before sending the Data Package, but it also made nothing,

Please help, what I am doing wrong?  
Thanks in advance,

---

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [February 12, 2020, 3:29pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328/2 "2020-02-12T15:29:15Z")

</div>

What does your payload for the input and output setup look like?

Our code which is in node as well looks something like this (old code and messy but it works):

```
rtde.connect(options, function(connected) {
  if (connected) {
    rtde.get_controller_version(version => {
      rtde.negotiate_protocol_version(
        options.RTDE_PROTOCOL_VERSION,
        status => {
          if (!status) process.exit;
          //Setup the outputs
          rtde.send_output_setup(
            watch.stateNames,
            watch.stateTypes,
            result => {
              rtde.send_start(status => {
                if (status) {
                  logger.info('RTDE Started', {
                    ip: host,
                    stateOfRTDE: 'started',
                    module: 'startRTDE',
                  });
                  setRobotState({ rtde: 'started' });
                  receiveRTDEData(() => {
                    if (typeof callback == 'function') return callback();
                    return;
                  });

```

That gives you the basic flow of how we are getting the connection established, starting the data stream and then receiving data from the stream.

Alslo, to have an external system control the outputs you will need to set the oputput bit mask to allow that, that is the RTDE packet `standard_digital_output_mask`, you will need to set the bits in the byte that you are trying to control remotely. This is the same as if you were using a PLC to control an output with Profinet or EIP.

---

<div class="post-metadata">

**Author:** ![anon21401016](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anon21401016](https://forum.universal-robots.com/u/anon21401016)\
**Post date:** [February 20, 2020, 5:16pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328/3 "2020-02-20T17:16:15Z")

</div>

Hi @mbush,

Thanks for your reply.

You can see an input setup at my first post. I am sending only input setup, should I send also output setup?

I do not understand fully what I have to do with standard\_digital\_output mask.

Suppose that I want to control DO0. In data stream that I am sending to RTDE server I have to include 2 informations: 1 for standard\_digital\_output and 1 for standard\_digital\_output\_mask?

---

<div class="post-metadata">

**Author:** ![604586722](https://avatars.discourse-cdn.com/v4/letter/6/ecb155/32.png) [@604586722](https://forum.universal-robots.com/u/604586722)\
**Post date:** [December 13, 2020, 2:37pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328/4 "2020-12-13T14:37:54Z")

</div>

Hello ,I just test that you should set standard\_digital\_output mask and standard\_digital\_output at the same time, for example ，if you want to set standard\_digital\_output to 3 ,then you also need to set standard\_digital\_output mask to 3 ,

---

<div class="post-metadata">

**Author:** ![lucas.johnson](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@lucas.johnson](https://forum.universal-robots.com/u/lucas.johnson)\
**Post date:** [April 10, 2024, 3:08pm UTC](https://forum.universal-robots.com/t/rtde-sending-input/6328/5 "2024-04-10T15:08:24Z")

</div>

Hi all,  
I’m now trying to connect to the UR using node red as well.  
Does anyone have a working flow example they could post here as a starting point?  
Thanks!
