# Suggestion for working with the bits of an integer

**URL:** <https://forum.inductiveautomation.com/t/suggestion-for-working-with-the-bits-of-an-integer/98758>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 18, 2024, 9:28pm UTC](https://forum.inductiveautomation.com/t/suggestion-for-working-with-the-bits-of-an-integer/98758 "2024-11-18T21:28:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bigtalljv](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@Bigtalljv](https://forum.inductiveautomation.com/u/Bigtalljv)\
**Post date:** [November 18, 2024, 9:28pm UTC](https://forum.inductiveautomation.com/t/suggestion-for-working-with-the-bits-of-an-integer/98758/1 "2024-11-18T21:28:14Z")

</div>

hi,

I am receiving an array of integer data from a Cummins generator to a PLC. In one integer they are using up to 15 of the bits for alarms and statuses. I need to make alarms for most of them and get the status of the others, any suggestions on a good way to work with that data in Ignition? I guess the most basic is to create an OPC tag for each individual bit but that will be dozens at least. I didn't know if there was a better way to do it?

Thanks

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 18, 2024, 9:34pm UTC](https://forum.inductiveautomation.com/t/suggestion-for-working-with-the-bits-of-an-integer/98758/2 "2024-11-18T21:34:32Z")

</div>

One way is to make one opc tag per integer and define an alarm per bit on each integer tag. This is a pretty common way of storing/configuring alarm information.

You could also go the route you are thinking and make a tag per bit, which helps with visualization and configuration(one alarm per tag instead of 16 alarms per tag)

If you have a large number of tags to set up, you can utilize [`system.tag.configure`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure) to script the creation of the tags all at once. [This post](https://forum.inductiveautomation.com/t/faster-way-to-input-tags/90877) has some decent information on how to achieve this.  
Pturmel also has his [Spreadsheet Import Tool](https://forum.inductiveautomation.com/t/spreadsheet-import-tool/93500) that may be of use if you're not as script savvy.
