# How to convert an integer value to bits?

**URL:** <https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027>\
**Category:** Ignition\
**Created:** [June 21, 2011, 7:54pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027 "2011-06-21T19:54:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![F\_Rayon](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@F\_Rayon](https://forum.inductiveautomation.com/u/F_Rayon)\
**Post date:** [June 21, 2011, 7:54pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027/1 "2011-06-21T19:54:01Z")

</div>

Hello.

I am reading data from a device and are integer values ​​but I need to manipulate bits.  
is there any way to convert integers to bits.

thanks.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [June 21, 2011, 9:06pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027/2 "2011-06-21T21:06:32Z")

</div>

If you already have an integer tag you can use the expression language in property binding to get out any bit. For example, to get the bit in position 1 do the following:`getBit({Path/To/Tag},1)`You can also reference bits in OPC item path field. In that case you would have a SQLTag per bit.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 21, 2011, 9:07pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027/3 "2011-06-21T21:07:08Z")

</div>

What driver are you using? If the driver supports bit-level reading and/or writing it will be much easier.

---

<div class="post-metadata">

**Author:** ![F\_Rayon](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@F\_Rayon](https://forum.inductiveautomation.com/u/F_Rayon)\
**Post date:** [June 21, 2011, 10:15pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-integer-value-to-bits/3027/4 "2011-06-21T22:15:27Z")

</div>

Worked with the expression.  
getBit ({Path / To / Tag}, 1)  
Thanks
