Solved

serial port communication

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 56
changeXy challenge 13 98
Sed question 2 139
Way to decrease size of apk file 9 132
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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