Solved

serial port communication

Posted on 1998-08-11
3
268 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
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 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now