CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014
    Posts
    3

    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

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    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
  •  





Click Here to Expand Forum to Full Width

Featured