LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert hexadecimal string to decimal number

I'm trying converts a hex string to decimal number.
I've use  "scan from string", "hexadecimal string to number", and anothers vi founded in forum, but I haven't solved.

Example: string (in hex): 21863B868
                decimal number: 8999123048

Thank you,

Vicen

LV 7.1 / WinXP
0 Kudos
Message 1 of 4
(4,192 Views)
There are several issues here, starting with I don't understand what your code has to do with what you are trying to accomplish.

Second, it sounds like you are trying to make this a lot harder than it really is. The value 21863B868 is the hex equivalent of 8999123048 decimal. So if you have a string containing "21863B868" all you have to do is pass it to the Hexadecimal String to Number function and you're done. Once the value is converted to an integer you can represent it for display purposes in any radix you like by simply modifying the display properties of the numeric indicator.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 2 of 4
(4,179 Views)
Hi vicens,

your problem is here: LabView7.1 doesn't support integers with 64 bit resolution (I64, U64) like LV8+ does. Your hex number has 9 digits, thus not fitting in a U32!!!

See attached vi, which converts your hex string to a DBL number. Be aware of getting into trouble because of limited precision of floating point numbers...

Message Edited by GerdW on 08-24-2007 01:10 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(4,176 Views)
Thank you both.
0 Kudos
Message 4 of 4
(4,164 Views)