用了u-blox GPS C#串口通信 [英] C# serial communication with u-blox gps

查看:602
本文介绍了用了u-blox GPS C#串口通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从u-blox.com用USB连接和驱动器的GPS。该驱动程序安装时,在插上USB弹出一个virual COM端口。使用超级终端,然后我可以看数据从GPS的流量。



然后我想我在程序的数据,不是那么容易的......



我已经实现了使用SerialPort类从GPS读取一些方法,但我没有成功。我已经设定多个串行设备的读者和作家之前在C#中,但是这一次阻止我



作为一个例子,在的 simpleSerial 不会给你任何东西,除非你拔下,然后重新插入USB接口。



试过阅读它与MATLAB,伟大的工程,但需要GPS数据我的程序的其余部分是在C#,无法很好地解决这个问题。



有一些高级别C#的事情事情在SerialPort类,我可以规避?或者是有任何已知的问题,读USB-serialports,我假设的作品就像我的GPS?


解决方案

从B-blox公司得到这个支持。



下面的十六进制命令将迫使GPS模块上的看门狗复位。




B5 62 06 04 04 00 00 00 00 00 0E 64



为ARM7起来的GPS $ b $这种低水平命令b它的工作原理与所有了u-blox GPS接收机。




 字节[]数据=新的字节[] {0xB5执行, 0X62,0×06,0×04,0×04,0×00,
为0x00,0x00时,为0x00,0x00时,为0x0E,0x64};
sp.Write(数据,0,data.Length);



这为我工作。


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?

解决方案

Got this from b-blox support.

The following hex command will force a watchdog reset on the GPS module.

B5 62 06 04 04 00 00 00 00 00 0E 64

this a low level command for the ARM7 uP in the GPS It works with all u-blox GPS receiver.

byte[] data = new byte[]{0xB5, 0x62, 0x06, 0x04, 0x04, 0x00,
                         0x00, 0x00, 0x00, 0x00, 0x0E, 0x64}; 
sp.Write(data, 0, data.Length);

It works for me.

这篇关于用了u-blox GPS C#串口通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆