Tag Type Boolean Array to set up Alarm Bit State. Am I doing it right?

Hi there,

I am trying to set up alarms on each individual bit using the BIT State condition on a BOOLEAN Array tag (in PLC it is DINT). When my bit 3 is high, I don't see the alarm Is Active? See images below. It might be a silly mistake I am doing but can't really make sense of it. Maybe use DINT Array?

Looks like it is not looking at the bit state in the array but the whole DINT itself.

image

Thanks!

I don't know the answer off the top of my head, but I'd say that a boolean array is likely not going to work with bit state, since the tag is not an integer which can be represented in base2; it's an array of bools. If you made the tag type an integer, you could use bit state. I'm curious to know how you'd ref items of a bool array though as it's useful to see the book values rather than just an integer. Probably with an expression that reads an array index from the tag value

1 Like

'... ref items of a bool array' - I was thinking the same. Interesting, thanks. Changing it to the array of Integer in Ignition gives me the same results. Sigh.

Have you tried just a plain integer? Non-array?

1 Like

Yes, that works. Up to 16 bits (int) and also plain Double (DINT) up to 32 bits in my case. Sadly, you can't browse their bits and see their state as you could if it was defined as an ARRAY type.

There's very little downside to defining separate boolean tags for each bit, each with its own alarm. Ignition's OPC driver is smart enough to read the integer once and divvy up the results.

2 Likes

I'm of the same thought as Phil. I always use single digital tags for alarms since they're then all there to see and easier to configure

1 Like

Agreed. That's the way I usually go. I was curious about this instance if there's an efficient way. Thanks for the insights.