# Indirect tag to individual bit value

**URL:** <https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377>\
**Category:** Ignition\
**Created:** [February 21, 2022, 4:39pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377 "2022-02-21T16:39:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Mears](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@Ian\_Mears](https://forum.inductiveautomation.com/u/Ian_Mears)\
**Post date:** [February 21, 2022, 4:39pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/1 "2022-02-21T16:39:59Z")

</div>

So I’ve attempted a few ways to do this.

I need to use an indirect tag to point to a specific controller name and a pathway to a specific AOI (allen bradley) and then to a specific bit of a value contained within.

This works fine until I get to the individual bit part. If I set the individual bit inside the indirect tag, it either doesn’t register as valid, or doesn’t read it at all.

{1}{2}/Alarm/Port/Port\_Alarm (This is the pathway to the word)

{1}{2}/Alarm/Port/Port\_Alarm.0 does not return a bit

Trying to do

getBit({Root Container.Controller\_Shortcut}{Root Container.Controller\_AOI}, 0)

as an expression gives errors. I’m not sure how I can point to an indirect tag’s individual bit, and not just the whole word/integer

---

<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:** [February 21, 2022, 4:47pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/2 "2022-02-21T16:47:47Z")

</div>

You can’t use bit suffixes with Ignition tags. You **can** use bit suffixes in OPC item paths for separate Ignition Tags. You are trying to use OPC item syntax in a GUI expression. That’s not possible. Create Ignition tags for the bits, using repeatable naming, and then you can use a dynamic tag path (not an item path) to pick the tag.

User interface expressions/bindings only get to target Ignition tags. You cannot tack on OPC syntax to drill in further.

---

<div class="post-metadata">

**Author:** ![Ian\_Mears](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@Ian\_Mears](https://forum.inductiveautomation.com/u/Ian_Mears)\
**Post date:** [February 21, 2022, 4:50pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/3 "2022-02-21T16:50:22Z")

</div>

Thanks, this was the direction I was going. I was just hoping it was built in without the need to create new tags for individual bits.

---

<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:** [February 21, 2022, 4:54pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/4 "2022-02-21T16:54:04Z")

</div>

If you expect to write back, you need the individual boolean tags. If not, you can use `getBit()` with an integer tag containing the desired bits.

---

<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:** [February 21, 2022, 4:56pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/5 "2022-02-21T16:56:44Z")

</div>

Do note that indirect tag bindings get **the** tag. If you need to use `getBit`, that is an expression function that will need to be pointed at the property that has the indirect tag binding. Use a custom property for the indirect binding if necessary.

---

<div class="post-metadata">

**Author:** ![Ian\_Mears](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@Ian\_Mears](https://forum.inductiveautomation.com/u/Ian_Mears)\
**Post date:** [February 21, 2022, 5:12pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/6 "2022-02-21T17:12:22Z")

</div>

is there an example of using ‘Getbit’ in the expression window and using property values for initial navigation?

syntax error: BOUND CONST. when attempting to use property values that have been assigned instead of tag path.

---

<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:** [February 21, 2022, 5:35pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/7 "2022-02-21T17:35:03Z")

</div>

Your expression will be something like this:

```auto
getBit({Root Container.AOI_Integer}, {Root Container.Desired_Bit})

```

Both of those would be integer custom properties in your Root Container.

The `AOI_Integer` property would have an Indirect Tag binding like so:

```auto
{1}/{2}/IntegerWithBits

```

Where `{1}` and `{2}` point at **String** properties in your Root Container with the partial paths to your desired tag. (I general only use `{1}` to point at the complete folder path.)

The `Desired_Bit` integer would be computed however you need. Or use a constant in getBit() if applicable.

The key is to separate the selection of a tag from the use of its content.

---

<div class="post-metadata">

**Author:** ![Ian\_Mears](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@Ian\_Mears](https://forum.inductiveautomation.com/u/Ian_Mears)\
**Post date:** [February 21, 2022, 7:05pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-to-individual-bit-value/56377/8 "2022-02-21T19:05:45Z")

</div>

That works for sure.

Appreciate the help, I see I was attempting to use multiple properties previously and it just wasn’t made to work the way I was trying to use it.

I’m able to point to the variable pointed locations and grab a bit as a value for indication now.
