# ControlLogix - Reference Bits within a Dint?

**URL:** <https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057>\
**Category:** Ignition\
**Created:** [February 25, 2014, 12:00pm UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057 "2014-02-25T12:00:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [February 25, 2014, 12:00pm UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/1 "2014-02-25T12:00:03Z")

</div>

Hi all, I’m evaluating Ignition and have a question about it’s ability to directly reference bits within a DINT tag with in a PLC specifically for ControlLogix/CompactLogix systems.

For example:

PLC\_DINT\_Tag. So 32 possible bit references.

I use DINT tags for SCADA animations to reduce tag counts (for those SCADA products that use # of tags for licensing). So PLC\_DINT\_Tag may contain 32 various animations for SCADA within a single tag.

In another SCADA program, I could reference at the bit level by appending the bit reference to the tag within the SCADA program:

PLC\_DINT\_Tag.00 (bit 0)  
PLC\_DINT\_Tag.01 (bit 1)  
PLC\_DINT\_Tag.02 (bit 2)  
.  
.  
.  
PLC\_DINT\_Tag.031 (bit 31)

Can you achieve this same effect with Ignition? If so, what is the Syntax? I really don’t want to have to create separate tags for each bit within the DINT tag.

Thanks!

---

<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:** [February 25, 2014, 1:48pm UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/2 "2014-02-25T13:48:25Z")

</div>

You’ve almost got it - just lose the leading zero and it should work.

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [February 26, 2014, 5:08am UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/3 "2014-02-26T05:08:44Z")

</div>

Apparently I am missing the obvious…

I found a DINT tag in my PLC, browsed to it via the OPC browser, dragged it into my SQLTags folder. I now have a DINT (int4) tag called “Tagname” in my project.

When I try to bind this tag to the visibility property on a rectangle, the following works:

Expression: {Tagname} = 1

Great, I can change visibility based on an integer value.

When I try to directly reference a bit, I get an error. I choose the “tag” option to bind the visibility to “Tagname”, then change the tag to “Tagname.0” to reference bit 0 as a true/false. I get the following errors:

“Tag Property ‘0’ is not a valid property”

“You must choose a tag or tag property in the tree”.

Thinking there must be a way, I edited the “Tagname” OPC Item Path to be Tagname.0, now this works when I bind “Tagname” to the visibility property of the rectangle. However, this isn’t the desired function as “Tagname” is now just a bool as it is directly referenced to the .0 bit in “Tagname”, and can no longer access the other 31 bits unless I make specific tags for each of those bits.

What am I missing?

---

<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:** [February 26, 2014, 2:09pm UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/4 "2014-02-26T14:09:34Z")

</div>

Ah, yeah, you’re not missing anything then.

For each bit you want to reference a tag has to exist. Not necessarily in the PLC, but definitely in SQLTags.

EDIT: Alternatively you can use the getBit() expression function if you’re trying to get the bit strictly in expressions. [inductiveautomation.com/support/ … getbit.htm](http://inductiveautomation.com/support/usermanuals/ignition/gen_logic_getbit.htm)

---

<div class="post-metadata">

**Author:** ![iakm19](https://avatars.discourse-cdn.com/v4/letter/i/ce7236/32.png) [@iakm19](https://forum.inductiveautomation.com/u/iakm19)\
**Post date:** [September 24, 2014, 9:55am UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/5 "2014-09-24T09:55:18Z")

</div>

it is posible to write/read bit reference directly //Control logix Tag

TestBitIgnition.0=1  
TestBitIgnition.1=1  
TestBitIgnition.2=1  
TestBitIgnition.3=0  
.  
.  
.  
TestBitIgnition.31=0

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [October 1, 2014, 2:44am UTC](https://forum.inductiveautomation.com/t/controllogix-reference-bits-within-a-dint/8057/6 "2014-10-01T02:44:50Z")

</div>

[quote=“iakm19”]it is posible to write/read bit reference directly //Control logix Tag

TestBitIgnition.0=1  
TestBitIgnition.1=1  
TestBitIgnition.2=1  
TestBitIgnition.3=0  
.  
.  
.  
TestBitIgnition.31=0[/quote]

In order to do this, you MUST specify a SQLTag in Ignition for each BIT you wish to reference You cannot do a bit reference like this on the Ignition SQLTag name, it as to be done at on the tag OPC path.
