Click here to Skip to main content
13,097,673 members (54,141 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Everyone,

I am trying to develop a program for sending a file through Serial port and read the same back. Here what i am doing is 1st sending the complete file through Serial Port and after that m reading it back. but if m sending large file then it creates a problem. I want to continuously fire the file and read the same back continuously and this is possible by using threads but i have never used it before. Can anyone pls help me with the Same?

If someone is not able to understand what m trying to do ask then do let me know>
Posted 4-Oct-12 22:32pm
Jochen Arndt 5-Oct-12 5:02am
See this question I have just answered. The code snippets may be helpful for you to read data from a serial port using a worker thread.
Not clear what's the problem. Of course, use a separate thread; one thread for port is usually enough (and more than one per port can easily create problems if you are not extremely careful). You did not provide exact protocol to tell you something concrete, but it should not be a problem. Unfortunately, it's impossible to describe all the aspects of multithreading you can possibly face in one simple answer. Please read on threading and try to implement it by yourself (perhaps, not your task at first but some simple skeleton prototypes). It's not extremely difficult; most applications these days are multithreading. As it looks like you work in the field of control systems or data acquisition; and in this field there is simply nothing to do without multithreading. If you face problem -- ask a qustion; we will gladly help you.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please see my comments to the question. And start, for example, here:[^].

And don't even play with the idea of serial (or any other) communication applications without multithreading. Same thing is you need to do SCADA, data acquisition, control systems, networking, and a lot more. It looks like the time to start for you is now!

The best of luck for you,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100