04-14-2021 05:30 AM
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.
Please check VI in att.
Please for advise..
Thanks a lot.
Solved! Go to Solution.
04-14-2021 06:07 AM
@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.
04-14-2021 06:10 AM
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.
04-14-2021 07:57 AM
@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.
04-14-2021 09:08 AM
I Think this is what you want:
04-15-2021 01:29 AM
Thanks all for quick support.
Values are from ftdi chip, which use dll, for sure written in C.
04-15-2021 03:05 AM
@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.
04-15-2021 07:56 AM - edited 04-15-2021 07:57 AM
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).