Reading data from serial port and plotting graph

  • Thread starter Thread starter CodeManInd
  • Start date Start date
C

CodeManInd

Guest
Hi all,

I am developing a program to read bytes from a serial port and plot a graph using this data.

I am using a serial port control and read data using ReadByte method in the data_received event of serial port and store the data in to a buffer( byte array). Data from this buffer is used to plot a graph(MS Chart control). I have implemented some logic to workout this, but what happens is that the app hangs when working.

What I need is that I want two threads to be written, one to read data from serial port and store the data to a buffer. Another thread to plot graph using this buffer. Please share some code to start two threads which works independent without causing any hanging of app.

Thanks in advance

Continue reading...
 
Back
Top