LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary string to hex limited to 32 bits

hello,

is there a way to convert a binary string to hex for more than 32 bits.  i attached a vi that does the conversion, but i can't figure out how to do it if my input binary string contains more than 32 bits.  thank you
0 Kudos
Message 1 of 3
(3,886 Views)

How may digits do you need? If 64 is enough, you could set the default to U64 and keep the rest as is. (You should place a small wait in your while loop though).

You should also set the lenght to the right size when you format to hex (8 for U32, 16 for U64, 2 for U8), else you'll potentailly loose leading zeroes.

For unlimited lenght, you need to e.g. use a loop. Attached is one simple possibility. (Be careful if the input string lenght is not a multiple of 8 or if it contains garbage characters).

 

 

0 Kudos
Message 2 of 3
(3,881 Views)
Thanks for the reply.  There could be a possibility anywhere from 0 to 240.
0 Kudos
Message 3 of 3
(3,875 Views)