LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to read an unsolicited serial variable string.

Hello,

I am new to LabVIEW and I am working on my first app. I have a serial device that I am trying to read from. This device periodically broadcasts a string containing 17 numeric values. Each value is delimitated and of a variable length.

I need to monitor the serial port and when the data comes in I need to parse off the different variables and make them available to the rest of the program.

Any suggestions on where to start and how I might do this would be appreciated. Thank you in advance.
Gregory Osenbach, CLA
Fluke
0 Kudos
Message 1 of 7
(3,439 Views)
I recommend using VISA to control the serial port.

You can use a while loop with a timer (10 ms or so) and a Property node for the VISA session to check for any data in the Serial port buffer (And read only if there's something there). By checking the string read for a delimiter (I presume \r or \n are sent to mark the end of the string) you can tell if the end of the string has been reached or not.

Once you're certain you have the full string, you can parse using the SCAN from string function (I've left this out of my example, because I don't know what format your string has).

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 7
(3,439 Views)
Thank you for the response. I have the capability to reprogram my serial device to output any format. What format would be preferable from a LabVIEW point of view?
Gregory Osenbach, CLA
Fluke
0 Kudos
Message 3 of 7
(3,439 Views)
Baud, stop bits etc. is purely personal preference.

LAbVIEW can read in basically any format, but I have a personal preference for tab seperators between values and newline/carriage return as a termination.

This way the text can be streamed to a text file and is readable afterwards in Excel usw....

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 7
(3,439 Views)
Thank you for your assistance. You have been very helpful. Cheers!
Gregory Osenbach, CLA
Fluke
0 Kudos
Message 5 of 7
(3,439 Views)

Hello sir

 

I need to read a serial data means, in FRA 1250 (Solartron) when we are sweeping, the o/p is a serial data.Through RS432 it is getting(hyper terminal) but through GPIB I cannot  get this data. I used Visa read. The error is Timed out.

 

if it is GPIB the hyper terminal is not working. I can control all the settings of FRA through PC and it will sweep.

 

Is it necessary a Scan from string palette after VISA read   or direct can we take the results. 

Message Edited by gireesh on 03-02-2010 08:09 AM
"Thanks with regards "
by
..........Gireesh..........
0 Kudos
Message 6 of 7
(2,930 Views)
0 Kudos
Message 7 of 7
(2,911 Views)