LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bitstream to hex

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 6
(1,238 Views)

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.

0 Kudos
Message 2 of 6
(1,228 Views)

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

0 Kudos
Message 3 of 6
(1,225 Views)

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)

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

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

Tnx all

 

0 Kudos
Message 6 of 6
(1,188 Views)