10-11-2018 12:09 AM
1. Read many lines of string character from serial port until no more new data
2. Process data
3. wait for the data available at comport to read
10-11-2018 12:44 AM
Its good to have two loops-Producer & Consumer Loop - (One for acquiring data and one for Processing the data).
In the Acquiring loop , Read number of bytes at port, once your number of bytes at port is greater than 0 then start reading then data from serial port.
10-11-2018 01:07 AM
I think it is what you are looking for
Benoit
10-11-2018 01:08 AM
Of course this is not your main VI but it will read all data available on the serial port.
Now add a loop for every 20sec... a GUI...
Benoit
10-18-2018 06:17 PM
Thanks for the help. I red the data insist while loop and no data at port then exit that while loop and pass the multistring into different while loop until empty string to exit the second while loop
10-18-2018 07:00 PM
You should not rely on the bytes at port for reading data. Your protocol should use a termination character, fixed data size or have a packet header that indicates how many bytes to read. Using bytes at port will eventually cause you problems as you will read the wrong amount of data at some point and your data will not be synchronized after that.