09-23-2014 06:44 AM
I am sending the adc reading on serial port and i want to convert the data acquired from serial port to an integer and plot it on the graph.so, how can i get the continuous data from serial port?
also help me to convert serial data to an integer.
09-23-2014 06:52 AM
Reading from a serial port - use the serial VIs located in palette under Instrument IO:Serial. There you will find various VI's such as configure port, read, etc.
To convert your data, I would suspect the string conversion VIs in the palette under Programming:String:Number/String Conversion would do the trick. There you will find various VI's that will convert almost any format string into a numeric such as a decimal string "123" into a decimal 123 or a double 123.0, etc. The one you want is most likely Decimal String to Number, but that depends on the particular format of your string.
09-23-2014 07:11 AM
Don't use the Serial functions. Use VISA. Trust me on this, it is a much better interface.
Look in the LabVIEW Example Finder (Help->Find Examples) and looks for a Simple Serial Write & Read (or something like that). It is a decent start for learning to use the API.
Now for converting the string data, well that totally depends on the format the instrument is putting out.
09-23-2014 07:30 AM
The "serial" palette VIs are actually VISA (at least in my palette).
09-23-2014 07:33 AM
You need to change only string to interger
09-23-2014 08:23 AM
@Ranjeet_Singh wrote:
You need to change only string to interger
I guess in strict technical terms, that is correct. If you want to turn them into meaningful integers, you have to know the format, as @crossrulz pointed out. (Which, of course, could bring us full circle and your solution is the correct one, after all.)