LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to number

Solved!
Go to solution
I really don't understand what you have done. What exactly do you mean by 'main data'? Are you or are you not appending a LF after a.single value? It looks like you are receiving multiple values separated by a comma. If so, this is an important detail that you should have provided.

Look at the details in your context help window when you move your mouse over the VISA Configure Serial Port function. In my first response, I told you this was the function.
Message 31 of 35
(1,088 Views)

What is the exact format you are sending out of your microcontroller?

 

I would recommend changing the view on the Read indicator to Hex Codes or / Codes to see a little better what is being sent.

 

The VISA Configure Serial Port is setting the termination character.  You don't have those settings wired up, so it is using the default of ON and 0xA.


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
Message 32 of 35
(1,079 Views)

@Dennis_Knutson wrote:
I really don't understand what you have done. What exactly do you mean by 'main data'? Are you or are you not appending a LF after a.single value? It looks like you are receiving multiple values separated by a comma. If so, this is an important detail that you should have provided.

Look at the details in your context help window when you move your mouse over the VISA Configure Serial Port function. In my first response, I told you this was the function.

thanks again , I'm really sorry.. I'm new to Labview. sorry for poor english too 🙂

 

I mean by "main data" that single value of the temp. sensor. in my circuit I read the value of sensor and convert that into string (by sprintf function in C) and then send it to serial port. 

 

this is what I got from your reply : I have to set the read byte to an arbitrary number ( for example 10 )  . and In microcontroller I have to send the single value followed by a termication code ( 0x0A ) .. and when the read function get termination code it stops reading.. 

 

and then I have to saperate the main value form teminate code ?? 

 

thanks 

0 Kudos
Message 33 of 35
(1,062 Views)

@crossrulz wrote:

What is the exact format you are sending out of your microcontroller?

 

I would recommend changing the view on the Read indicator to Hex Codes or / Codes to see a little better what is being sent.

 

The VISA Configure Serial Port is setting the termination character.  You don't have those settings wired up, so it is using the default of ON and 0xA.


thank you again.

 

I send ascii code from microcontrolelr.. as I mentioned in previous post its a converted data (from integer to string) by sprintf function 

0 Kudos
Message 34 of 35
(1,061 Views)

finally I think I coudl do that.. I send a (0x0a) code after the temp. value , and now I have in read buffer sthing like this > for example 26.5\n . but when I convert that into number it just give me 26.5 and seems it doenst need to be saperated and it knows itself that 26.5 is the main value Smiley Very Happy

0 Kudos
Message 35 of 35
(1,055 Views)