Read the bits of a int tag

Hi, we have an int tag in our plc called Alarms whose bits are used for individual alarms. is there an option to view or read each of these bits other than creating an individual tag for each bit? I need this because we need to see the alarms in the alarms banner

There is a Bit State alarm mode - you could define an alarm on the one tag for each of the significant bits.

1 Like

Barring Kevin's advice, which seems like probably the best approach.

In an expression there are multiple ways this can be accomplished. Probably the most straight forward is the getBit() expression.

getBit({path/to/tag/value},5) //returns the value of the 5th bit in the tag

In scripting there are again multiple ways to accomplish this. Here is one.

def getBit(value, bit):
    return (value & (1 << bit)) >> bit

thank you so much