# Access single bit within a DINT data type

**URL:** <https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785>\
**Category:** Ignition\
**Created:** [May 1, 2024, 7:06pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785 "2024-05-01T19:06:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 1, 2024, 7:06pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/1 "2024-05-01T19:06:39Z")

</div>

I need to access single bits within a DINT data type versus manually creating single bits from within the DINT. How can I do this?

---

<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:** [May 1, 2024, 7:09pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/2 "2024-05-01T19:09:58Z")

</div>

In what context do you need to access them? Expression? Another tag? Script? Just read the bit, or write to it as well?

> [@michael.black](#):
>
> versus manually creating single bits from within the DINT

Can you try explaining this in another way?

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 1, 2024, 7:17pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/3 "2024-05-01T19:17:13Z")

</div>

Sure. I am creating a UDT and am currently reading in the DINT. I then have a label object with a few states (text and color) where I want to look at the value of one bit within the DINT. Or maybe I could create a boolean tag within the UDT that accesses the DINT but find bit 3 (.3) of the UDT?

---

<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:** [May 1, 2024, 7:18pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/4 "2024-05-01T19:18:11Z")

</div>

The [getBit expression](https://docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/getBit) is probably all you need.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 1, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/5 "2024-05-01T19:19:24Z")

</div>

If you are just reading them:

> [@Read 16-Bit Modbus Input Register to two 8-Bit tags](https://forum.inductiveautomation.com/t/read-16-bit-modbus-input-register-to-two-8-bit-tags/29614/2):
>
> I had written a UDT for DINT to BIT. Feel free to modify to your needs. [DINT2BIT\_UDT.xml](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/990bf35ca7703ec7d47bcf79abdc40bbbc0b4761.xml) (8.9 KB)

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 1, 2024, 7:21pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/6 "2024-05-01T19:21:11Z")

</div>

Nice...I'll check it out.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [May 1, 2024, 7:27pm UTC](https://forum.inductiveautomation.com/t/access-single-bit-within-a-dint-data-type/89785/7 "2024-05-01T19:27:38Z")

</div>

It worked. I knew there was something like this, just couldn't locate it right away. Thanks
