# Use bool tag or use int tag and covert to bit values in client

**URL:** <https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 8, 2023, 8:38pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587 "2023-08-08T20:38:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [August 8, 2023, 8:38pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/1 "2023-08-08T20:38:21Z")

</div>

Looking for thoughts on / potential performance issues.

40,000k integer values but only looking at the bit values within those integers  
Not writing to those bits only reading.  
Displaying around 150 of those bit values on screen at one time.  
Option 1. Tag with integer value and then on vision window convert int to bit values for display  
Option 2. Tag with integer value and expression tags with bit values of that int  
Option 3. Just bool tags with bit values

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 8, 2023, 9:46pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/2 "2023-08-08T21:46:34Z")

</div>

If a native IA driver, and it supports bits of integers natively, just use #3.

Otherwise, probably #1, but worth testing #3.

#2 is a terrible idea.

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [August 8, 2023, 9:51pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/3 "2023-08-08T21:51:38Z")

</div>

AB device

Problem we are seeing is memory usage. My prefered way is Option 3. since the bit values are what is needed and don't care about the int value. However if we switch to Option 1 thinking maybe the ints will take up less gateway memory, but then could reading those bits with expression in the window cause issues on the front end.

Currently looking at 5mil tags / IO server with 5 IO servers; However we still have a few more tags to add and will likely get in the range of 7mil tags per io server. with 5 mil tags we are hitting about 30gb of memory used.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 8, 2023, 10:12pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/4 "2023-08-08T22:12:06Z")

</div>

> [@rfolkes](#):
>
> but then could reading those bits with expression in the window cause issues on the front end.

Stay away from the `tag()` expression function. If using indirect tag bindings to pull the integers to the front end as needed, then extracting the bits in Vision, and only in Vision, then it probably would save significant gateway memory.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 8, 2023, 10:13pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/5 "2023-08-08T22:13:22Z")

</div>

> [@rfolkes](#):
>
> will likely get in the range of 7mil tags per io server

Sounds like a fun project!

---

<div class="post-metadata">

**Author:** ![rfolkes](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rfolkes](https://forum.inductiveautomation.com/u/rfolkes)\
**Post date:** [August 10, 2023, 2:30pm UTC](https://forum.inductiveautomation.com/t/use-bool-tag-or-use-int-tag-and-covert-to-bit-values-in-client/77587/6 "2023-08-10T14:30:55Z")

</div>

ok just FYI for anyone else coming across this.

I setup 2 IO servers with

one using a UDT with 4 integer tags and then vision window converting those integers to bit in expression with indirect tag binding.

Other using UDT with 4 folders with 16 bit values of those 4 integers (64 tags of bits values total per udt)

Each IO server had 59982 of these UDTs so ~240k integers vs 3.8mil Booleans

Vision window would display 1000 of these UDTs at one time

Difference in memory was roughly around 10GB Less for integers  
Difference in page load was marginal around a 1 sec slower for the integer UDT

I typically prefer to have the bit values in SCADA if the integer value is not meaningful, but in this case I think it is better to go with integer value and convert to bit on display as needed.

Of note- We do not need to record history or alarm these bits or write values from SCADA --\> PLC
