-
May 10th, 2014, 03:23 PM
#1
Data seem stucking when deburging with Serial Port
Hello,
I am making a MFC application with VC++2012 with receiving data from Serial Port and the data is stored in a Listbox, then after processing (convert into numbers) and get these data to draw a sine wave on the chart. (I intend to make a virtual oscilloscope).
Everything works ok at the beginning, but after receiving about 300 items or above (in the Listbox) the value seem stucking (or lagging) and work very slowly.
I receive data by the SerialPort_DataReceived() method, and process of converting and drawing chart also in this method, I think this makes the system overload!!!!
Does anyone has the problem like me???And have any better idea for my solution!!!
Thanks
Siegener
-
May 11th, 2014, 03:36 AM
#2
Re: Data seem stucking when deburging with Serial Port
The usual design of such type of application is:
a main GUI thread where you display data
plus
a worker thread that receives data from serial port and post it to the main thread.
See Serial Port I/O, Using Worker Threads
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|