# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## ASCII to decimal number

Hello all,

I have array of ascii numbers which I need to translate into number.

I used type cast, to convert each byte into decimal number, then concatenate into string.

This string contains multiple ''space'' characters, so I cannot translate this string into number.

Thanks a lot.

Message 1 of 8
(282 Views)
Solution
Accepted by topic author milan87

## Re: ASCII to decimal number

@milan87 wrote:

Hello all,

I have array of ascii numbers which I need to translate into number.

I used type cast, to convert each byte into decimal number, then concatenate into string.

This string contains multiple ''space'' characters, so I cannot translate this string into number.

Message 2 of 8
(259 Views)

## Re: ASCII to decimal number

Or:

It's not clear what the \00 should do, separate numbers or end the one value...

The main problem in your solution is that the numbers are I32s. Converting them the characters (U8s) will give you 4 characters.

Message 3 of 8
(257 Views)

## Re: ASCII to decimal number

@milan87 wrote:

I have array of ascii numbers which I need to translate into number.

How are you getting this array?  It seems to me that you are doing something just a little off if you are getting an array of I32 values.  This looks like it is a C string, so I am guessing it is coming from a DLL.  You should be able to read a string straight from the DLL and then you just need Fract/Exp String To Number to convert it into a DBL.

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
Message 4 of 8
(208 Views)
Solution
Accepted by topic author milan87

## Re: ASCII to decimal number

I Think this is what you want:

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 8
(190 Views)

## Re: ASCII to decimal number

Thanks all for quick support.

Values are from ftdi chip, which use dll, for sure written in C.

Message 6 of 8
(148 Views)

## Re: ASCII to decimal number

@milan87 wrote:

Thanks all for quick support.

Values are from ftdi chip, which use dll, for sure written in C.

If it returns I32s when it should return U8s, something's suboptimal at best, wrong at worst.

Message 7 of 8
(140 Views)

## Re: ASCII to decimal number

wiebe@CARYA wrote:

@milan87 wrote:

Thanks all for quick support.

Values are from ftdi chip, which use dll, for sure written in C.

If it returns I32s when it should return U8s, something's suboptimal at best, wrong at worst.

I suspect you can do something more like this so that you have the string directly (one less conversion that needs done).

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
Message 8 of 8
(111 Views)