AnsweredAssumed Answered

Bit manipulation in PI PE/Analytics for 16bit integer values

Question asked by 529931 on Apr 20, 2017
Latest reply on Apr 21, 2017 by 529931

Hello All,

We have a PLC that sends us a 16 bit integer register, where each bit indicates different alarm statuses. I would like to manipulate the value of each bit, by shifting the bit to right and then performing an AND operation with 1.

 

Value of bit = (Number >> n) &1

where, n is the nth bit.

 

I am trying to do this with PI PE/analytics, but not able to find the shift operators. Could you please help me with this.

I would also like to know if we have any other ways of determining the bit, if shift operators are not supported in PI. Thanks in advance.

 

Thanks,

Nandhini.S

Outcomes