LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to number

Solved!
Go to solution

that is good one bilko Smiley Very Happy Smiley Very Happy Smiley Very Happy

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 21 of 35
(1,481 Views)

I have a particular power supply in mind... it even specifies a "typical" time to wait for the power supply to process the last command - sheesh!  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 22 of 35
(1,478 Views)

Looks like you found some device to do R&D with...Great.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 23 of 35
(1,476 Views)

the function which jcarmody posted was that thing I want, it converts my string to number and I can use that as a numeric variable.. like connecting to Thermometer or chart.. thank you 🙂

 

to that friend who told I didn't use any delay in while loop: I send the data from microcontroller every second I mean I set my delay in my main code in microcontroller.. is that ok ? 🙂

 

another question : would you explain how to set the count byte input of read function ? I set that on 4 .. but when the temp. goes above of 100 degree (5 character)

it shows it wrong... any idea ? 🙂

 

 

0 Kudos
Message 24 of 35
(1,450 Views)
As discussed, the recommendation to use a wait is not correct.

Use some high arbitrary number for a byte count. Your program says to use a termination character (a LF) for the Read. This is set with the VISA Configure Serial Port and means the read will automatically terminate when the character is detected.
0 Kudos
Message 25 of 35
(1,448 Views)

@Dennis_Knutson wrote:
Use some high arbitrary number for a byte count. Your program says to use a termination character (a LF) for the Read. This is set with the VISA Configure Serial Port and means the read will automatically terminate when the character is detected.

Also note that you need your microcontroller to send this termination character in order to have the VISA Read terminate on it.  As already stated, a Line Feed (0xA) is the default for VISA.  Since you are apparently dealing with ASCII characters, that would be a good option.


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 26 of 35
(1,439 Views)

@crossrulz wrote:

@Dennis_Knutson wrote:
Use some high arbitrary number for a byte count. Your program says to use a termination character (a LF) for the Read. This is set with the VISA Configure Serial Port and means the read will automatically terminate when the character is detected.

Also note that you need your microcontroller to send this termination character in order to have the VISA Read terminate on it.  As already stated, a Line Feed (0xA) is the default for VISA.  Since you are apparently dealing with ASCII characters, that would be a good option.


 

thank you Dennis_Knutson and crossrulz..

 

would you explain a little more ? you mean I shoud send (0x0A) code after the main data ?? 

0 Kudos
Message 27 of 35
(1,425 Views)
Yes. Program your micro to append the LF at the end. You can use other values but your LabVIEW code is currently programmed to expect that. If its not programmed to send a termination character, I would have expected your program to generate a warning.
0 Kudos
Message 28 of 35
(1,419 Views)

@Dennis_Knutson wrote:
Yes. Program your micro to append the LF at the end. You can use other values but your LabVIEW code is currently programmed to expect that. If its not programmed to send a termination character, I would have expected your program to generate a warning.

I've just select the blocks and put them together and wired them.. I didn't know it would need that. what makes my labview code to expect that ?? Smiley Sad

0 Kudos
Message 29 of 35
(1,413 Views)

I applied the 0x0a ascii code after main data .. but It didnt responsed in labview .. the data was swing up and down..

 

this is my code : Untitled.jpg

and I set the byte count to 10.. the result is like this : 23.123.223 , 24.123.223 ... << 10 characters .. :-??? Smiley Sad

0 Kudos
Message 30 of 35
(1,407 Views)