Masking PLC Tag Data in Ignition

Is there a way to mask PLC tag data when creating a tag in Ignition by using the OPC Path or by creating an expression tag from another Ignition tag.

For instance: If I have a 32 bit tag in a PLC and I want to read the first 16 bits (LSB) into one integer tag and read the last 16 bits (MSB) into another integer tag. The 32 bit tag in the PLC is actually the combined data of two different process values.

I know I can pull individual bits in for a Boolean data type, but I need to pull multiple bits in to an integer to create their BCD equivalent.

I realize this is extremely easy in the PLC, but in this instance doing this in Ignition is the best solution and easiest if it is possible.

I’ve searched topics related to this, but haven’t been able to come up with the right key word to find anything that may have already been posted on this subject.

You should be able to do this using expression tags. The standard bitwise operators are part of the expression language.

For reference, if you read your 32-bit value using an OPC tag, you would create two 16-bit (Int2) Expression tags. The expressions to use would be LSB: {[~]32_bit_tag} & 65535 MSB: {[~]32_bit_tag} >> 16

1 Like