# How te read actual\_digital\_output\_bits

**URL:** <https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683>\
**Category:** Robot Communication\
**Created:** [April 16, 2021, 8:26am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683 "2021-04-16T08:26:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon25121844](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@anon25121844](https://forum.universal-robots.com/u/anon25121844)\
**Post date:** [April 16, 2021, 8:26am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/1 "2021-04-16T08:26:34Z")

</div>

Hi, maybe it’s silly but I’m trying to find out how can I read particular outputs values from actual\_digital\_output\_bits.  
Maybe someone figured out how to read it via RTDE?

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [April 16, 2021, 10:53am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/2 "2021-04-16T10:53:02Z")

</div>

Recording example on [Real-Time Data Exchange (RTDE) Guide - 22229](https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/) is reading output bits.  
Fields can be either specified directly in` send_output_setup()` method, or like in an example through record\_configuration.xml file.

---

<div class="post-metadata">

**Author:** ![anon25121844](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@anon25121844](https://forum.universal-robots.com/u/anon25121844)\
**Post date:** [April 16, 2021, 10:57am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/3 "2021-04-16T10:57:56Z")

</div>

Thank you for your answer.  
I mean I know how to read it from the robot but I receive dec value ex.256 which doesn’t seem to match the data I have configured on digital outputs.

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [April 16, 2021, 11:16am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/4 "2021-04-16T11:16:38Z")

</div>

Value combines all output ports - standard, configurable, and tool. 256 means that configurable output 0 is high (bit 8 is high), and all other outputs are low. Is this more what you would expect?

---

<div class="post-metadata">

**Author:** ![anon25121844](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@anon25121844](https://forum.universal-robots.com/u/anon25121844)\
**Post date:** [April 16, 2021, 11:22am UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/5 "2021-04-16T11:22:44Z")

</div>

Thats it! Im looking for a way how you “decode” it. I tried to change this dec to binary but it doesnt realy work for me.

---

<div class="post-metadata">

**Author:** ![mmi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mmi/32/691_2.png) [@mmi](https://forum.universal-robots.com/u/mmi)\
**Post date:** [April 16, 2021, 1:42pm UTC](https://forum.universal-robots.com/t/how-te-read-actual-digital-output-bits/13683/6 "2021-04-16T13:42:18Z")

</div>

You can use boolean operators in python, like:  
` if(reg & 1 << 8):`  
` print("CO0 HIGH")`  
` else:`  
` print("CO0 LOW")`
