GPSSerial library

derez

Expert
Licensed User
Longtime User
GPS in CE 6.0 device

Trying to run a GPS application on CE 6.0 device , I get an "IOexception" error when opening the com port of the gps. The program runs well on windows mobile devices. Other gps programs (not b4ppc) also run when launched in the same environment.

Is it possible that the .net of the CE6 is not compatible ?

Has anybody experienced the same problem ?

Attached is a simple program to demonstrate the problem. Am I overlooking something :confused:

Thanks.

Edit: Tried also the example program from GPS library help - with the same results. (using serial2 & GPS.dll)
 

Attachments

  • port.sbp
    1,005 bytes · Views: 8
Last edited:

penserv

Member
Licensed User
Do you have any examples of how to parse the GPGGA string for example? I've been trying, quite unsuccessfully, to do just that. I did have some success with StrSplit method from B4P, but no luck at all with NMEAReadString. When I use StrSplit, I have to dim the array as string and then convert back to a double if I want to use the Lat or lon from GPGGA with a converter to get UTM. I was wondering if NMEAReadString returned a string value or a number for lat or lon?
 

penserv

Member
Licensed User
Is it possible for you to write two new methods to get the Latitude and Longitude from a GPGGA string rather than a GPRMC string? I have an app that receives GPGGA strings at 5 Hz and binary EM data at 10 Hz. I would prefer to only have a single gps data stream coming in rather than two, although maybe it doesn't make any difference, but I don't know. I'm using a Trimble Recon 400 MHz data collector with two serial ports. COM1 for gps is at 19200 baud and COM2 for EM is at 115200 baud. Maybe you can tell me whether I'm worrying about nothing or not. I haven't started to collect the binary data stream, but I plan to use an ASCII sentence with UTC Time, UTMx, UTMy, Elevation, HDOP, Number of Satellites and Fix Quality and then append the binary stream onto the end of it.
 

agraham

Expert
Licensed User
Longtime User
NMEAReadString is the raw byte stream. It doen't return a string or a number for anything, you would have to parse out what you want from the stream.

As the GPGGA sentence is available ready parsed as a string use StrSplit on that and don't wory about the conversion as it would have to be done anyway. For efficiency just use variables typed as Number for Lat and Lon once you have obained them.
 

penserv

Member
Licensed User
I'm getting a strange error after I parse the GPGGA string. The first time I run the program on the desktop, I get this message...

An error occurred on sub.main.displaygps
Line number 58
lstData.Add("1 - UTC Time = " & words(1))
Error description:
Index was outside the bounds of the array.

The error message is pretty straight forward EXCEPT, when I click on Continue, it goes away and the program functions normally. It parses the GPGGA string and writes out the data file like it should. So why does this error message appear in the first place and how do I make it go away? this message only appears on the desktop program. The device program functions normally, so I'm starting to think it might be something to do with my USB-Serial connection and not even related to B4P.

You will recognize most of the code as I have only modified your GPSSerial example.View attachment GPSSerialData3.sbp
 

penserv

Member
Licensed User
I'm getting another error message that I don't understand from the same code I just sent you. It's a compile error, which says "The given key was not present in the dictionary." The line number indicates the error is in this line of code (highlighted by *****)...

words() = StrSplit(Gps.GPGGA,",")
***** lstData.Add("0 - GPGGA = " & words(0)) *****

This is a new error, presumably because I haven't closed something when I last compiled? Does B4P have automatic garbage collection?
 
Top