# How can I manipulate UDINT variables to display bits on HMI? (VC4)

**URL:** <https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842>\
**Category:** HMI & Visualization\
**Tags:** vc4\
**Created:** [May 6, 2025, 7:02am UTC](https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842 "2025-05-06T07:02:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rishikesh\_Patil](https://avatars.discourse-cdn.com/v4/letter/r/FF8800/32.png) [@Rishikesh\_Patil](https://community.br-automation.com/u/Rishikesh_Patil)\
**Post date:** [May 6, 2025, 7:02am UTC](https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842/1 "2025-05-06T07:02:04Z")

</div>

I am facing an issue where I have used a UDINT variable in logic, and now I want to display individual bits on the HMI—for example, `variable.0`, `variable.1`, etc., as statuses. However, in the visualization (Visu), there is no option to do this, as the variable is being displayed as an integer.

Do you have any suggestions on how to achieve this?

---

<div class="post-metadata">

**Author:** ![pavel.vavra](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/pavel.vavra/32/9893_2.png) [@pavel.vavra](https://community.br-automation.com/u/pavel.vavra)\
**Post date:** [May 6, 2025, 8:35am UTC](https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842/2 "2025-05-06T08:35:46Z")

</div>

Hello,

Extract individual bits into boolean variables in the task, and then display these boolean variables in an HMI.

---

<div class="post-metadata">

**Author:** ![Rishikesh\_Patil](https://avatars.discourse-cdn.com/v4/letter/r/FF8800/32.png) [@Rishikesh\_Patil](https://community.br-automation.com/u/Rishikesh_Patil)\
**Post date:** [May 6, 2025, 8:50am UTC](https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842/3 "2025-05-06T08:50:59Z")

</div>

Thank you for your response  
I have already implemented this solution for now, it is working, but it doesn’t seem quite right. I’d like to standardize it, so I’m looking for a better approach.

---

<div class="post-metadata">

**Author:** ![SvenG](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/sveng/32/1835_2.png) [@SvenG](https://community.br-automation.com/u/SvenG)\
**Post date:** [May 7, 2025, 10:10am UTC](https://community.br-automation.com/t/how-can-i-manipulate-udint-variables-to-display-bits-on-hmi-vc4/6842/4 "2025-05-07T10:10:06Z")

</div>

Maybe it should be a solution to try bit shifting to convert your value into bits

some snippet

```
        alarm_bitarray[0] = ((yourValue) >> (0))&1;
	alarm_bitarray[1] = ((yourValue) >> (1))&1;
	alarm_bitarray[2] = ((yourValue) >> (2))&1;
	alarm_bitarray[3] = ((yourValue) >>(3))&1;
	alarm_bitarray[4] = ((yourValue) >> (4))&1;
	alarm_bitarray[5] = ((yourValue) >> (5))&1;
	 ......

```

with regards  
Sven
