Solved

serial port communication

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
Complete beginner needs help making a cron job 9 116
maven archtype selection in eclipse 1 57
FizzBuzz challenge 9 80
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

17 Experts available now in Live!

Get 1:1 Help Now