LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bit-String to Hex

Hello

I've got following question: I have a STRING of bits e.g. "01001010". Is there any function to convert it to Hex - code?
0 Kudos
Message 1 of 4
(3,075 Views)
See the attached code. I wasn't sure by what you meant by a "STRING of bits" so it shows two different things.

Remember also that the distinctions between binary, decimal and hex are only significant to human beings reading the numbers--computers don't really care. An unsigned 8-bit value is an unsigned 8-bit value, regardless of how it's represented for human consumption.

Note that in a array the LSB is the first element. In a string, the LSB is the far right-hand digit.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(3,075 Views)
Thanks Mike

That was it really what I need. I know that a computer doesn't care about the values. But I need that to create my PDU --> HEX Code. Its a little bit trick and I hope it will work!
0 Kudos
Message 3 of 4
(3,075 Views)
The only other thing you will need to be careful about is the bit order. Does the PDU protocol want to the the LSB or the MSB of each word first?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(3,075 Views)