# RTDE change output

**URL:** <https://forum.universal-robots.com/t/rtde-change-output/1602>\
**Category:** Robot Communication\
**Created:** [February 7, 2018, 1:01pm UTC](https://forum.universal-robots.com/t/rtde-change-output/1602 "2018-02-07T13:01:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![niclas.akesson](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@niclas.akesson](https://forum.universal-robots.com/u/niclas.akesson)\
**Post date:** [February 7, 2018, 1:01pm UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/1 "2018-02-07T13:01:29Z")

</div>

I want to be able to change the value to a “standard output” (standard\_digital\_output) and a “tcp output” (tool\_digital\_output) on the robot trough the rtde interface.  
I’ve no problems to to read values like in- output (binary) and analog signals, but I don’t know how to change values. At the rtde-guide I’ve seen this sentence, but I have no clue how to do this by the python-send-method \<\*Digital and analog output values have to be sent together with mask, otherwise values will be ignored\>

Could someone give me a code examples for changing DO (standard and tcp) and analog… Please!

---

<div class="post-metadata">

**Author:** ![niclas.akesson](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@niclas.akesson](https://forum.universal-robots.com/u/niclas.akesson)\
**Post date:** [February 7, 2018, 7:45pm UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/2 "2018-02-07T19:45:47Z")

</div>

If I want to set the “tool\_digital\_output nr1” to be “1”, I would like to do the following (not working):

#–code–\>  
#-\> I guess this is the binary number for the output (in this case there are only 2 outputs 0 and 1)  
setp.tool\_digital\_output = 1  
#-\> I guess this is the value/status for the output ( 0 or 1 )  
setp.tool\_digital\_output\_mask = 1  
con.send(setp)

I’ve got an xml-file where I’ve defined the mask and the output as uint8 (key=setp) from the basic example provided by UR (control\_loop\_configuration.xml)

---

<div class="post-metadata">

**Author:** ![niclas.akesson](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@niclas.akesson](https://forum.universal-robots.com/u/niclas.akesson)\
**Post date:** [February 7, 2018, 9:50pm UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/3 "2018-02-07T21:50:45Z")

</div>

Never mind, I figured it out myself by using an exponential value… But still I think more code examples for the rtde would help new users like me!

---

<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 8, 2018, 2:50am UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/4 "2018-02-08T02:50:37Z")

</div>

Can you please post here what you actually did to make this work so that others can learn from you? I would like to learn more about how to make that work as well for some projects that I am working on.

Thanks!

---

<div class="post-metadata">

**Author:** ![kxpang](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kxpang](https://forum.universal-robots.com/u/kxpang)\
**Post date:** [March 1, 2021, 8:02am UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/5 "2021-03-01T08:02:21Z")

</div>

Just in case anyone still searching for answer like me, this is how I use it,

set _standard\_digital\_output\_mask_ to 2^(digital\_output\_number) to command that particular digital output.  
set _standard\_digital\_output_ to 0 to set it to LOW or 2^(the number same as above) to set it to HIGH.

so for example I want to set digital\_output\_3 to HIGH I will do  
standard\_digital\_output\_mask = 8  
standard\_digital\_output = 8

set digital\_output\_3 to LOW I will do  
standard\_digital\_output\_mask = 8  
standard\_digital\_output = 0

---

<div class="post-metadata">

**Author:** ![xucongingermany](https://avatars.discourse-cdn.com/v4/letter/x/91b2a8/32.png) [@xucongingermany](https://forum.universal-robots.com/u/xucongingermany)\
**Post date:** [October 18, 2022, 1:26pm UTC](https://forum.universal-robots.com/t/rtde-change-output/1602/6 "2022-10-18T13:26:21Z")

</div>

❤ Thank you very much, this problem has been bothering me for several days, today because I saw your answer finally solved!
