ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string number to hex number conversion problem

hello,

i have a conversion from a string number array to a string hex array conversion problem.

first i take the string number array and then convert it to a numeric number array and then to a hex string array.

this is what i am getting through for the conversions.

string number = 1111
numeric value = 1111
hex value        =  457

i was expecting F

i attache the vi because it seems easier to understand visually
0 Kudos
Message 1 of 7
(4,521 Views)
The number 1111 is 457 in hex
The number 15 is F in hex and is 1111 in binary

Message Edited by Matt W on 09-01-2006 05:29 PM

0 Kudos
Message 2 of 7
(4,514 Views)
You just need to scan the input number as a binary formatted number. (You try to read it a decimal: one thousand one hundred and eleven).
 
(See attached modification, LabVIEW 8.0)
Message 3 of 7
(4,503 Views)

Unfortunately,

I don't have LV-8.x and cannot see Altenbach's vi.  Most likely very elegant 😉

Here is a version in LV7.0. 

RayR

0 Kudos
Message 4 of 7
(4,499 Views)
Yup, mine's a bit simpler ;).
 
 
(he actually wanted a hexadecimal formatted string output. So the "first half" of my code is about equivalent to yours. If the binary string has more than 8 digits, we would need to change to a longer integer type, of course)
 
 

Message Edited by altenbach on 09-01-2006 06:27 PM

Message 5 of 7
(4,497 Views)

Very nice Altenbach,

I like it.  I didn't know if there was a maximum lenght to the binary string which is why I start with the string length.

Thanks for the image.

RayR

0 Kudos
Message 6 of 7
(4,476 Views)
Thank you very much
0 Kudos
Message 7 of 7
(4,414 Views)