# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Bitstream to hex

Hello,

I need to send a bitstream to a Arduino with rs232 ,the bitstream has to be converted in to Hex nybbles and send as a hex character/

the bitstream looks like this 0,0,0,1,1 etc as a I8  array.

I have to send a string with characters T1A followed by the Bitstream in Hex terminated with a X.

How can i convert the bitstream to Hex characters?

Anyhelp is deeply appreciated,

Philip

Holland

Message 1 of 6
(1,238 Views)

## Re: Bitstream to hex

Any particular reason the bitstream is an I8 array instead of a boolean array?

If you were working with booleans, you could Boolean to Number and be done.

With the I8, you'll have to do some bitwise manipulation.

Brute force would be to loop through and use shifts and ORs to pack your 8-bit hex number.

Message 2 of 6
(1,228 Views)

## Re: Bitstream to hex

I get the bitstream from a pocsag encode vi, can i convert this bitstream to booleans?

Message 3 of 6
(1,225 Views)

## Re: Bitstream to hex

There are two LabVIEW functions you want to learn to use:

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 4 of 6
(1,222 Views)

## Re: Bitstream to hex

As a quick thought, you could loop through your I8 and use a selector to build an array of Booleans.  Then use the Boolean Array to Number function on the array of Booleans.  This seems a bit Rube Goldbergish though.

Message 5 of 6
(1,217 Views)
Solution
Accepted by topic author Philip1969
08-27-2015 04:09 PM

## Re: Bitstream to hex

Solved it, made  U8 to Boolean array in a loop ,had to reverse the bit order.

Tnx all

Message 6 of 6
(1,188 Views)