LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a string from RS-232

I have an application that needs to read in a set-length string of 13 data readings seperated by a commas. I have a vi set up that will take the incoming string and seperate it out to its different data points. BUT, when I'm reading in the data over the serial port, I don't know how to wait until I have a complete set of 13 data points before displaying my data. I'm using a vi that extracts doubles from the string to display all 13 data points, and as each point is recieved from my test item, it scrolls through the 13 seperate data displays.

Basically, I need advice on how to read in a full string of 13 data points and after the full string is read in, then display them using an extract_from_string vi.

Thanks in advance

jimmy
0 Kudos
Message 1 of 2
(2,629 Views)
You need to use a While loop, reading from the COM port until you've received all your data. Use a shift register on your while loop and the string concatenate function to save your data as you are reading it. Count the commas so you'll know when you're done. You can then use one of the string search functions to split the string at the comma delimiters. You may also want to include a timeout in your loop so you can generate an Error Out instead of waiting in an endless loop.

P.S.: You posted this to the LabWindows forum. It should be posted to the LabView forum.
0 Kudos
Message 2 of 2
(2,627 Views)