Trying to link a bool state to the bite of a integer

Hi, I am trying to link the state of many boolean to each bite of an integer located in my UDT tag but it seem that i cannot target each bit. I can only taget the integer in its integrity. Is there a way to link the state of a boolean to the bite of an integer that is located in a UDT?

An expression or derived tag using the getBit or getBit/setBit expression functions could work. The latter scenario is probably prone to race conditions, though, so if you only need to read the bits that would be ideal.

Thanks. I will try it rigt now

Thank you it is working well to read but i would neef to be able to write into my integer as well. Is there an other fonction that would work?

That would be the setBit and derived tag approach I mentioned.

What kind of tag is the source tag? This isn't the ideal approach if you need to write. If it's an OPC Tag then it would be better if the server you're connected to supports a syntax for bit addressing instead.

bit = binary digit.
byte = a group of bits - usually 8.
bite = cut into or through something using teeth!

Ok thanks! Each bool are from different object in my window.

If they aren't connected to an OPC device, just use actual boolean tags. Separate ones.

1 Like

Thank you it worked well!