
- reading-NMEA-data-from-COM-port
- 11-22-2007
If you were Registered and logged in, you could reply and use other advanced thread options
Hi,
I am developing a GPS data logging application in C++, basically a
windows
service where i read GPS data from the device and write it to a text
file. I use CreateFile function passing the port number as an
argument. The GPS device outputs the data every second. I want to
identify this event i.e., i want to read from the port only when the
GPS outputs the data. Currently my program is not in sync with the
device causing my program to read only a part of the data i.e., if
the
device outputs 6 lines of data my program read only the first few
lines or the last few lines of the data. I want to synchronise my
program with the device. I want to read data only when it outputs the
data. Is there a way to do this. Is there an event which i can handle
when the device outputs the data?
Thanks
bharath
> Currently my program is not in sync with the device causing my program to
This doesn't sound like a GPS problem. Perhaps a C++ forum would be a
better place to ask this qustion.
--
Clarence A Dold - Hidden Valley Lake, CA, USA GPS: 38.8,-122.5
On Thu, 22 Nov 2007 04:15:46 -0800 (PST), bharath_r
>Hi,
>I am developing a GPS data logging application in C++, basically a
>windows
>service where i read GPS data from the device and write it to a text
>file. I use CreateFile function passing the port number as an
>argument. The GPS device outputs the data every second. I want to
>identify this event i.e., i want to read from the port only when the
>GPS outputs the data. Currently my program is not in sync with the
>device causing my program to read only a part of the data i.e., if
>the
>device outputs 6 lines of data my program read only the first few
>lines or the last few lines of the data. I want to synchronise my
>program with the device. I want to read data only when it outputs the
>data. Is there a way to do this. Is there an event which i can handle
>when the device outputs the data?
>Thanks
>bharath
>I am developing a GPS data logging application in C++, basically a
>windows
>service where i read GPS data from the device and write it to a text
>file. I use CreateFile function passing the port number as an
>argument. The GPS device outputs the data every second. I want to
>identify this event i.e., i want to read from the port only when the
>GPS outputs the data. Currently my program is not in sync with the
>device causing my program to read only a part of the data i.e., if
>the
>device outputs 6 lines of data my program read only the first few
>lines or the last few lines of the data. I want to synchronise my
>program with the device. I want to read data only when it outputs the
>data. Is there a way to do this. Is there an event which i can handle
>when the device outputs the data?
>Thanks
>bharath
You need an interrupt-driven serial receive routine. This routine
will be called each time the UART has received a character, and will
store the received character in a buffer. The main program can then
read the data from the buffer at its leisure.
--
Peter Bennett, VE7CEI
peterbb4 (at) interchange.ubc.ca
new newsgroup users info : http://vancouver-webpages.com/nnq
GPS and NMEA info: http://vancouver-webpages.com/peter
Vancouver Power Squadron: http://vancouver.powersquadron.ca
> Hi,
> I am developing a GPS data logging application in C++, basically a
> windows
> service where i read GPS data from the device and write it to a text
> file. I use CreateFile function passing the port number as an
> argument. The GPS device outputs the data every second. I want to
> identify this event i.e., i want to read from the port only when the
> GPS outputs the data. Currently my program is not in sync with the
> device causing my program to read only a part of the data i.e., if
> the
> device outputs 6 lines of data my program read only the first few
> lines or the last few lines of the data. I want to synchronise my
> program with the device. I want to read data only when it outputs the
> data. Is there a way to do this. Is there an event which i can handle
> when the device outputs the data?
> Thanks
> bharath
You will need to essentially generate that event yourself, i.e. parse and
> I am developing a GPS data logging application in C++, basically a
> windows
> service where i read GPS data from the device and write it to a text
> file. I use CreateFile function passing the port number as an
> argument. The GPS device outputs the data every second. I want to
> identify this event i.e., i want to read from the port only when the
> GPS outputs the data. Currently my program is not in sync with the
> device causing my program to read only a part of the data i.e., if
> the
> device outputs 6 lines of data my program read only the first few
> lines or the last few lines of the data. I want to synchronise my
> program with the device. I want to read data only when it outputs the
> data. Is there a way to do this. Is there an event which i can handle
> when the device outputs the data?
> Thanks
> bharath
package up the data yourself. But google around first, I found some Java
code some time ago that did that, theres probably some C/C++ examples also.
You might need multiple threads also to avoid losing data from the serial
port.
Depends on your language. More details, please.
I do it just find in Visual Basic. Never miss a character.
Mike
On Thu, 22 Nov 2007 04:15:46 -0800 (PST), in sci.geo.satellite-nav
>Hi,
>I am developing a GPS data logging application in C++, basically a
>windows
>service where i read GPS data from the device and write it to a text
>file. I use CreateFile function passing the port number as an
>argument. The GPS device outputs the data every second. I want to
>identify this event i.e., i want to read from the port only when the
>GPS outputs the data. Currently my program is not in sync with the
>device causing my program to read only a part of the data i.e., if
>the
>device outputs 6 lines of data my program read only the first few
>lines or the last few lines of the data. I want to synchronise my
>program with the device. I want to read data only when it outputs the
>data. Is there a way to do this. Is there an event which i can handle
>when the device outputs the data?
>Thanks
>bharath
>I am developing a GPS data logging application in C++, basically a
>windows
>service where i read GPS data from the device and write it to a text
>file. I use CreateFile function passing the port number as an
>argument. The GPS device outputs the data every second. I want to
>identify this event i.e., i want to read from the port only when the
>GPS outputs the data. Currently my program is not in sync with the
>device causing my program to read only a part of the data i.e., if
>the
>device outputs 6 lines of data my program read only the first few
>lines or the last few lines of the data. I want to synchronise my
>program with the device. I want to read data only when it outputs the
>data. Is there a way to do this. Is there an event which i can handle
>when the device outputs the data?
>Thanks
>bharath
- NMEA data format
- Global Positioning System
- 2011-07-25
- Looking for NMEA data viewer
- Satellite Navigation
- 2009-11-23
- How to save GPS (usb) NMEA data to text file time/lat/lon/alt ?
- Global Positioning System
- 2007-04-29
- Do you have any NMEA data?
- Satellite Navigation
- 2007-06-03
- Garmin 60Csx & NMEA
- Garmin GPS
- 2010-01-14
