?
Solved

serial port communication

Posted on 1998-08-11
3
Medium Priority
?
277 Views
Last Modified: 2013-11-20
my windows app receives data from a photometrical device over the serial port and writes the data to a file.
I have a problem recognizing the stop of data transmission as there is no special character sent by the device
such as EOF. How can I recognize the end of data flow?
0
Comment
Question by:elazabi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Expert Comment

by:snoegler
ID: 1320562
If this device does not switch any status lines, like DTR or so, you will have NO possibility to
check this ... you have to rely on the data you get. Does the data format this device sends
allow an assumption about the end of the file? If not, another possibility would be to use a
timeout - i.e. when device sends continously data, then you may assume that a break of about
1000 msec ( which all users should accept without stopping your app) can be treated as
an EOF signal.
Fact is, without any information you can't get no information :)
0
 
LVL 1

Expert Comment

by:slinky
ID: 1320563
The may not be a special character at the end, but is there a typical pattern you can spot in the last part of the data?
Failing that, snoegler is right, timeout would be the way to go.
0
 
LVL 4

Accepted Solution

by:
piano_boxer earned 300 total points
ID: 1320564
What about delays inbetween messages.

<serial datapacket 1> <X ms delay> <serial datapacket 2>

If there is a delay, then you can use the interchar timeout value to determine when a complete packet has been received.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question