C# serial communication with u-blox gps

cgpsserial-portusbserial

I have a GPS from u-blox.com with a USB-connection and driver. The driver installs a virual COM port that pops up when you plug the USB in. Using a hyperterminal I can then watch the flow of data from the GPS.

Then I want the data in my program, not so easy…

I have implemented some methods using the serialPort class to read from the GPS, but am unsuccessful. I have programmed several serial device readers and writers before in C#, but this one stops me.

As an example, the simple code in simpleSerial will not give you anything unless you unplug and replug the USB.

Have tried reading it with matlab, which works great, but as the rest of my program that needs the GPS data is in c#, that doesn't quite fix the problem.

Is there some high level C# things going on in the serialPort class that I can circumvent? Or is there any known problems reading USB-serialports, which I assume works like my GPS?

Best Answer

I have sucessfully used the SerialPort class in .Net 2 also with gps on a virtual comport. It seems your virtual comport driver is slightly off. If you can't locate a newer driver I would suggest you call the WinAPI functions for reading the serial port.

Take a look at this code for instance: http://www.codeproject.com/KB/system/SerialPortComm.aspx

Related Topic