Is it better to make 16 OPC tags to read UDT structure booleans or 1 OPC tag to read an Integer and use the getBit() expression?

We're trying to make a large, scalable system with Perspective, and right now we're thinking about how Ignition will interact with the UDTs in the program.

We have one UDT where it is 16 booleans with various status flags for a motor. I think some or most of these will end up being alarm tags and be on a direct tag group as well. Since there will be a lot of these (several hundred sets per project), I'm wondering what the best way to set up the tags is. This will be an Allen-Bradley Control Logix L84 running version 36. My two options are:

Make a UDT in Ignition with 16 OPC tags, looking at each boolean element of the UDT directly.

Copy the UDT booleans into a single Integer, have Ignition read that one value over OPC, and then make 16 expression tags with the getBit() function to separate the individual flags back out again.

My instinct is telling me the second option would be better since it's one OPC tag instead of 16, but would I be sacrificing overhead somewhere else. I saw some other posts on the forums here stating that the OPC driver is smart enough to read in the whole integer if you specify OPC paths at the bit level, but does this still happen if the Bits are encapsulated in a UDT where they have names?

I hope I'm making sense.

One other consideration: will you ever want to write to a bit?

In this particular case, no. These are status bits, so I will only be reading them.

Make the driver do the bit separation work. It will do it much more efficiently that any possible expression with getBit().

Presumably, there will be other information in the UDTs you also want to monitor. Put them on the same group pace as the bits and they will all be read efficiently together.

3 Likes