Indirect tag to individual bit value

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

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.

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.

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.

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.

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.

Your expression will be something like this:

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:

{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.

1 Like

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.