Accessing individual bits in controllogix

This thread is pretty old…

We are trying to use the notation “[Device,bit=1]Variable” in control logix. At first it seems to work but all thoses tags:

They all seems to adress the same bit (bit 0).

Any idea?

I have never seen this syntax. Where did you find it? The OPC item address for a logix bit of a DINT is dot-bit number as a suffix. Like [Device]Variable.0 or [Device]Variable.31.

Never mind. Top of the old topic. Never had to do that. /-:

I’m confused. Where did we land on this? Can we access individual bits of a DINT in controllogix for read and write?

I haven’t been able to get it to work.

Use the dot-number suffix syntax. Works for me.

I have a button script with:
system.tag.writeSynchronous(“CLX064/IGN_Bit_Test.2”, 1, 5000)

I get this error:
Tag property ‘2’ is not a valid property

What should the syntax be in this example?

Never mind. I figured it out. I had to set it up in the Tag Browser with the .2 as a boolean.

Thanks for the help.

1 Like

You could have also used system.opc.writeValue (and the appropriate OPC Item Path), which will work even if you don’t have a tag set up for it in the Tag Browser.

I didn’t realize I could do that. That will help a lot.