473,466 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Talking with USB GPS in VB.Net

Hi, I would like know how make the 'conversation' between VB.Net and Garmin
USB GPS, someone know work that?.

I have a etrex Vista Cx (USB cable connector), I would like make a program
for get the current GPS position, but I donīt understand how send commands
or receive data for this port.

Thanks in advance for any help, Iīm very lost.

Freddy Coal
May 3 '07 #1
14 15235
Hi,

There is one "standard" GPS protocol, NMEA-0183. This serial protocol is
fairly easy to work with. However, it is even easier if you download
DecodeGPS from my homepage. The DecodeGPS .NET dll is free, and I include
example code. The source code for the dll is in my book (see below), along
with additional information. IMO, you should make sure that your GPS
receiver outputs data using this protocol (commands also may be issued to
the receiver using NMEA-0183, though very few applications require that the
GPS receiver be programmed).

Garmin also has a proprietary binary protocol. It can be used instead of
NMEA-0183. Again, there are very few applications that would require use of
this binary protocol, and it is much more difficult to use than the ASCII
(NMEA-0183) protocol. I suspect that your actual receiver uses the NMEA
protocol by default (and it may not even support the binary one, so that may
not even be an issue).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 3 '07 #2
Thanks Dick, very interesting DLL; I know the NMEA protocol, but I don't
understand how make the communitaction with the USB port.

I download the GPS Decoder example code, but he send errors, because I donīt
have the MapPoint. Your DLL work with USB or only with serial port?.

Thanks in advance.

Freddy Coal

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:uE**************@TK2MSFTNGP05.phx.gbl...
Hi,

There is one "standard" GPS protocol, NMEA-0183. This serial protocol is
fairly easy to work with. However, it is even easier if you download
DecodeGPS from my homepage. The DecodeGPS .NET dll is free, and I include
example code. The source code for the dll is in my book (see below),
along with additional information. IMO, you should make sure that your
GPS receiver outputs data using this protocol (commands also may be issued
to the receiver using NMEA-0183, though very few applications require that
the GPS receiver be programmed).

Garmin also has a proprietary binary protocol. It can be used instead of
NMEA-0183. Again, there are very few applications that would require use
of this binary protocol, and it is much more difficult to use than the
ASCII (NMEA-0183) protocol. I suspect that your actual receiver uses the
NMEA protocol by default (and it may not even support the binary one, so
that may not even be an issue).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

May 3 '07 #3
Hi,

You can get a demo version of MapPoint Europe, if you want.

I will create a simpler demo tomorrow that simply places the location
(lat/lon) in a textbox. I will let you know when it is available.

What version of Visual Studio are you using? The actual serial port code
depends on this (if VS 2005, you can use the built-in serial port control,
if using 2003, then download DesktopSerialIO.dll from my homepage).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 3 '07 #4
Thanks for your answer Dick, Iīm using VS2005, I know how use the serial
port, but I donīt know how get data with the USB port.

My GPS is Garmin etrex Vista Cx - USB connector.

For the MapPoint, maybe you can try with MapWindow (
http://www.mapwindow.org/ ) it's a really excellent tool and itīs free.

Thanks in advance if you can help to get the data using the USB port.

Freddy Coal
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:Ob**************@TK2MSFTNGP03.phx.gbl...
Hi,

You can get a demo version of MapPoint Europe, if you want.

I will create a simpler demo tomorrow that simply places the location
(lat/lon) in a textbox. I will let you know when it is available.

What version of Visual Studio are you using? The actual serial port code
depends on this (if VS 2005, you can use the built-in serial port control,
if using 2003, then download DesktopSerialIO.dll from my homepage).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

May 3 '07 #5
Hi,

A USB serial adapter (such as is used by your GPS receiver) is just another
serial port. Instead of a hardware UART, it uses a virtual serial port
device driver that emulates the hardware. You treat it like any other
serial device.

I have decided to create a control that encapsulates the serial port class,
GPS receiver detection, and GPS (NMEA-0183) decoding. All that you will
have to do is to drop it on a Winforms application, call the EnableGPS
method, and it will automatically detect your GPS receiver, and start
generating GPSDecode events that you can use to query its built-in
properties for Lan/Lon/Speed/Course/Date&Time, etc. I will post it on my
website on Monday, so look for it then.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 4 '07 #6
Freddy,

I have posted the GPSControl that I mentioned to my web site. It requires
only one line of code to strart it up, and as few as two lines of code to
read the decoded GPS location (Lat/Lon). Naturally, there are more "things"
than just location data, if you need them. It does automatic GPS detection,
so you don't have to do anything tricky to use it.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 5 '07 #7
Dick, I try your library, but don't work for me. I use your program, but the
program doesn't establish connection.

Maybe this works with a Serial connector, but my GPS have a direct
connection to the USB port; I read in internet that the new Garmin don't
have the NMEA.

http://www.oreillynet.com/xml/blog/2...proprieta.html

Thanks in advance for your help.

My Best regards,

Freddy Coal

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:Od**************@TK2MSFTNGP06.phx.gbl...
Freddy,

I have posted the GPSControl that I mentioned to my web site. It requires
only one line of code to strart it up, and as few as two lines of code to
read the decoded GPS location (Lat/Lon). Naturally, there are more
"things" than just location data, if you need them. It does automatic GPS
detection, so you don't have to do anything tricky to use it.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

May 7 '07 #8
Hi,
>>
Maybe this works with a Serial connector, but my GPS have a direct
connection to the USB port; I read in internet that the new Garmin don't
have the NMEA.
<<

If it doesn't output NMEA, then it can only be used with proprietary
software (or you can write your own, if it uses the Garmin "standard" binary
protocol). What documentation do they offer for the protocol that it does
use?

BTW, as I said before... USB GPS receivers ARE serial devices. That is,
they emulate a standard serial port via the device driver that is installed
with the device (look in Device Manager under Control Panel then view Ports.
You should see it listed there).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 8 '07 #9
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in
news:#H**************@TK2MSFTNGP03.phx.gbl:
BTW, as I said before... USB GPS receivers ARE serial devices. That
is, they emulate a standard serial port via the device driver that is
installed with the device (look in Device Manager under Control Panel
then view Ports. You should see it listed there).
No not all - some of the newer Garmins (i.e. NUVI) show up as mass storage
devices and have no NEMA serial interfaces :(
May 8 '07 #10
Dick, I know the binary protocol, but I donīt understand how make the
connection with the USB GPS with VB.Net; You know how make that?.

My GPS not emulate a serial device, under ports (Device Manager) don't
appear nothing different when I connect the GPS.

Thanks in advance for any help.

Freddy Coal

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,
>>>
Maybe this works with a Serial connector, but my GPS have a direct
connection to the USB port; I read in internet that the new Garmin don't
have the NMEA.
<<

If it doesn't output NMEA, then it can only be used with proprietary
software (or you can write your own, if it uses the Garmin "standard"
binary protocol). What documentation do they offer for the protocol that
it does use?

BTW, as I said before... USB GPS receivers ARE serial devices. That is,
they emulate a standard serial port via the device driver that is
installed with the device (look in Device Manager under Control Panel then
view Ports. You should see it listed there).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.

May 8 '07 #11
Hi,

You are right, if is isn't designed as a serial device, then there is no
(practical)way to interface with it.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 8 '07 #12
Hi,

No. If it is a proprietary interface, then probably they do not intend that
you use it. If you can get programming information from Garmin, then there
may be a way. If not, then it would cost FAR too much to even consider.

Why not just buy a different GPS receiver? You probably can get one for
less than $60.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
May 8 '07 #13
Have a look at the Garmin SDK. It has lots of documentation for
interfacing with the USB port. I'm wading my way through it right now.
There is also a program out there called "Spanner" (free from Garmin)
which will fake NMEA on a serial port.

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #14

Hello. I am a college student here in the Philippines. I have the same
concern as Mr. Freddy. I have this Garmin GPS16LVS which is capable of
transmitting NMEA sentences and I would like to access these sentences
in Visual Basic 6.0 through the USB port. The set-up is like this. I
furnished a DB9 (female) connector for the gps, then I attached a
USB-to-Serial converter so that I could connect it to my laptop(since my
laptop doesn't have a db9 port). I used the garmin sensor configuration
program to verify that it transmits NMEA sentences, and it does.

I tried opening Mr. Dick's codes in VB6 but the file extensions need to
be .vbp not .vbproj. When I opened the .vbp file, the texts are all
colored red. I'm also quite a newbie in VB 6.0 Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jane Austine | last post by:
I need to control a command line program via python. I first tried popen2 and 3 but I couldn't find a way to talk to the subprocess interactively; that is, read some and then write some, and...
10
by: robbie carlton | last post by:
I understand that c was originally designed to write and communicate with the unix operating system. Until recently I ignored this, as I was mostly polaying with opengl. I am now interested in...
6
by: Don | last post by:
Environment: VB6 under W98 I have a USB hardware device I wish to program directly. The original software installed a low level driver and the hardware is both registered and operational. Now...
11
by: seattleboatguy | last post by:
I am trying to send a message from a visual c++ user-thread to the main window, so the main window can update text on the window to reflect what the user-thread is doing. I have tried 2 different...
2
by: Simon T. | last post by:
Hello All, I am new to C# and the .NET framework, so please forgive and pity me if the question and understand reveals massive ignorance. I am trying to get SerialPort talking to a "Standard...
3
by: pamelafluente | last post by:
I am new to asp.net. I have an asp page with a submit button which sends out some information. Instead of having IIS to respond and deal with this information, I would like to have a .NET...
1
by: Daniel | last post by:
what is best way to talk to https webpages within .net? any good librarys for talking to https websites?
20
by: raylopez99 | last post by:
Dvorak is always interesting, albeit speculative. What hidden gem has he found in Vista that helps developers? It can't be .NET/CLI, that's been out forever. RL Vista rollout hides reality...
1
by: Pumpkin Carver | last post by:
I have a form that has a listview on it and a serious of strings in the listiew. When i doubel click on the listview item it opens a new form and displays the text that i pass to the constructor....
20
by: Steven D'Aprano | last post by:
Am I the only one who finds that I'm writing more documentation than code? I recently needed to write a function to generate a rank table from a list. That is, a list of ranks, where the rank of...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.