Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

String to decimal

Hello,

I'm a new to labview, and i'm currently working on a project which consist in retriving data from a microcontroller by RS232

 

So to summerize my problem : the computer recive data from the µController, as an ascii string, and i would like to convert it into decimal (for instance the computer recive a message as an ascii string :"A"  and i would like to convert that A into it's decimal form which is 65)

 

note : i already tried to use the String to Byte Array (Programation / String / Path conversion) and it doesn't fit for my work since i need to multiply it by some factors (-1)

 

TLDR : How to convert an ascii string in a decimal number, preferably into a long 32 bit integer

0 Kudos
Message 1 of 5
(3,631 Views)

the string to byte array is the best method.

After that copy this byte data to an array of I32 or I64 and do your calculations.

 

don't use a typecast but really copy to an array that k=has more bits per element.

greetings from the Netherlands
0 Kudos
Message 2 of 5
(3,630 Views)

like i said i just started, i don't really know when you're talking about a L32 or l64, where can i find these elements ?

0 Kudos
Message 3 of 5
(3,623 Views)

I documented a bit about the array, and i find a way to use it thanks for the respond though

0 Kudos
Message 4 of 5
(3,619 Views)

Go to the Numeric->Conversion palette.  With these, you can change the data type from a byte array to an I32 array.


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 5 of 5
(3,618 Views)