Solved

serial port communication

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

821 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