Bookmark this page: Add reading NMEA data from COM port to Yahoo MyWeb Add reading NMEA data from COM port to Google Bookmarks Add reading NMEA data from COM port to Windows Live Add reading NMEA data from COM port to Del.icio.us Digg reading NMEA data from COM port! Add reading NMEA data from COM port to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by bharath_r on November 22, 2007, 7:15 am


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



Posted by dold on November 22, 2007, 10:40 am


> 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

Posted by Peter Bennett on November 22, 2007, 12:56 pm


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

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

Posted by Roger Tango on November 23, 2007, 8:26 am



> 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
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.



Posted by Just_a_fan on December 19, 2007, 10:29 pm


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