LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert long hex string to decimal vlaue

Hi All,

 

I did typecasting to convert hex string to decimal which is only working fine for only 16 bytes (if i typecast to 64 uint 32 datatype).

 

If i want to convert more than "911083110000831104009119" how to do that.

 

right now it is working only for "9110831100008311".

 

How to convert full hex string to decimal value.

 

Kinldy suggest me.

 

Regards

Punith

 

 

0 Kudos
Message 1 of 9
(3,539 Views)

What format do you want in the end?  A 64-bit numeric is the largest integer I have seen.  Do you want an array of numerics?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(3,529 Views)

not sure if thats what you mean

stringhextonum.png

 

replace the wire from "uI64" with one from "uI32"

right-clicking on the numeric-constant and "Representation" lets you change the datatype


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 9
(3,523 Views)

jwscs wrote:

replace the wire from "uI64" with one from "uI32"

right-clicking on the numeric-constant and "Representation" lets you change the datatype


Slight problem with that: The hex string is 24 characters, which equates to 96 bits.

 

Maybe we should take a step back.  Punee, what exactly are you trying to do with the data.  I seriiously doubt you are trying to deal with 96-bit numbers.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(3,513 Views)

I am taking output from my hardware which in hex string format , now  i need to some calculation  by converting to decimal then resulted value should set numeric indicator.

 

So my hardware giving random hex string ,it may be 1,2,4 byte , 8 byte, 16, or 24 byte. This i need to convert to decimal.

 

How

 

 

 

 

0 Kudos
Message 5 of 9
(3,494 Views)

The fallowing example is not working for 1byte and 2 byte and 3 byte. Could you please tell me , how to solve this.

 

Regards

Punith

0 Kudos
Message 6 of 9
(3,491 Views)

i think the problem lies with Least- and MostSignificantBit.

 

it might be that you have to fill your "hex-string" with leading zeros too


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 9
(3,477 Views)

Ah.  You are being sent raw data, not ASCII formatted characters.

 

Again, the 24 (and 16) byte will be an issue since a U64 is only 8 bytes.  So we are left with the question of how you want to either display this or process in some way.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 9
(3,465 Views)
You need to provide some documentation on this device that sends 24 bytes that represents a dbl.
0 Kudos
Message 9 of 9
(3,463 Views)