Suggestion for working with the bits of an integer

hi,

I am receiving an array of integer data from a Cummins generator to a PLC. In one integer they are using up to 15 of the bits for alarms and statuses. I need to make alarms for most of them and get the status of the others, any suggestions on a good way to work with that data in Ignition? I guess the most basic is to create an OPC tag for each individual bit but that will be dozens at least. I didn't know if there was a better way to do it?

Thanks

One way is to make one opc tag per integer and define an alarm per bit on each integer tag. This is a pretty common way of storing/configuring alarm information.

You could also go the route you are thinking and make a tag per bit, which helps with visualization and configuration(one alarm per tag instead of 16 alarms per tag)

If you have a large number of tags to set up, you can utilize system.tag.configure to script the creation of the tags all at once. This post has some decent information on how to achieve this.
Pturmel also has his Spreadsheet Import Tool that may be of use if you're not as script savvy.

1 Like