LabVIEW Logical Shift Function to Encode and Decode Unsigned Integer Values

Updated May 28, 2025

Environment

Software

  • LabVIEW

I want to encode three U32 values into a single U64 value and then decode them correctly on the receiving end. How to do it programatically using LabVIEW?

LabVIEW provides Logical Shift Function to bitshift left and Bitwise- OR operator to encode three U32 values into a single U64 value. Similarly, bitshift right (negative values) to decode a single U64 into three U32 values

 

  • To encode three U32 values into a single U64,  bitshift left the first value by 32 bits ("Y1-BitShift left" = 32) and the second value by 16 bits ("Y2-BitShift left" = 16)

  • To decode, bitshift right the right by 32 bits ("Y1-BitShift Right" = -32) and the second value by 16 bits ("Y2-BitShift Right" = -16)