467,116 Members | 1,256 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,116 developers. It's quick & easy.

Programming for USB Modem

I'm using VB.NET 2003.

Device manager reports that my USB Modem is using COM 6.

For what it is worth the manufacturer has failed over a period of two years
to supply example code or methods.

The example program "VB.NET How-To: Using the Comm Port" does not dectect
COM 6.

The Active X control MSComm32.ocx also fails to detect COM 6 with the
open=true method.

The C++ program from http://www.naughter.com/enumser.html DOES detect the
port using three of six methods tried:
CreateFile method
QueryDosDevice method
GetDefaultCommConfig method

HOWEVER, I am not familiar enough with C++ to translate the methods used to
VB.

Can I get a Visual Basic example using showing similar methods to detect and
open the port the USB modem is using and allow me to send a series of AT
commands to it?

--
Don Ford
Feb 28 '06 #1
  • viewed: 7832
Share:
8 Replies
Hi Don,

Download DesktopSerialIO from my homepage and see if it works (it uses
CreateFile, etc.). BTW, it is free.

The problem with MSComm may be a function of the device driver that was
written for the virtual serial port in use. MSComm uses a "fast-open"
method that can fail under certain circumstances -- though I wouln't have
thought that this was one of them.

I've never seen the sort of thing that you are seeing, so I cannot be sure
exactly what may be happening.

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.
See www.hardandsoftware.net for details and contact information.
Feb 28 '06 #2

--
Don Ford
"Dick Grier" wrote:
Hi Don,

Download DesktopSerialIO from my homepage and see if it works (it uses
CreateFile, etc.). BTW, it is free.

The problem with MSComm may be a function of the device driver that was
written for the virtual serial port in use. MSComm uses a "fast-open"
method that can fail under certain circumstances -- though I wouln't have
thought that this was one of them.

I've never seen the sort of thing that you are seeing, so I cannot be sure
exactly what may be happening.

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.
See www.hardandsoftware.net for details and contact information.

Feb 28 '06 #3
Looks like my first reply got trashed!

The DesktopSerialIO program gets an exception at .CommPort = 6

For what it is worth, Phone Dialer and Microsoft Outlook access the modem
very nicely.

--
Don Ford

Feb 28 '06 #4
Hi,

For what it is worth, Phone Dialer and Microsoft Outlook access the modem
very nicely
<<

These are TAPI applications (different APIs). You might try downloading the
demo version of the new Sax Serial .NET control (www.sax.net). It is TAPI
compliant. Let me know what it does.

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.
See www.hardandsoftware.net for details and contact information.
Feb 28 '06 #5
Hi again Dick,

I installed a demo version of Sax CommStudio Fall 2005. The .NET programs in
that package (both VB and C#) find Com 1 only; not even as many ports as the
other programs find.

So... I also upgraded the VS6 modem example to VS2003 and ran that. It finds
the modem and retieves the manufacturer name and model correctly.

I'll try to trace what it does - but if this information helps to set me
straight please feel free to tell me where to start! ;)

If nothing else, if we generate material here for Edition 5 I'll gladly buy
it! :)

Don Ford
"Dick Grier" wrote:
These are TAPI applications (different APIs). You might try downloading the
demo version of the new Sax Serial .NET control (www.sax.net). It is TAPI
compliant. Let me know what it does.

Dick


Mar 1 '06 #6
Hi,

So... I also upgraded the VS6 modem example to VS2003 and ran that. It finds
the modem and retieves the manufacturer name and model correctly.
<<

Is there anything special (different) about the way the port is specified in
the call to CreateFile? That is the only thing that I can think of. If you
can post the syntax that is used, it may help.

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.
See www.hardandsoftware.net for details and contact information.
Mar 1 '06 #7
I'll have to work on this on weekends, now that my vacation is over. :(

I'm trying to find a chunk of code in DesktopSerialIO that will let me
communicate with the smart modem.

I'm also trying to find example code showing TAPI in VB - I found a DLL that
will work with VB, tapi3.dll, but the initialize function causes an
exception. Either I'm using it incorreclty, or TAPI is simply not going to
work with this modem.

I also have a third help request in with the manufacturer. Nothing from them
yet.

--
Don Ford
"Dick Grier" wrote:
Hi Don,

Download DesktopSerialIO from my homepage and see if it works (it uses
CreateFile, etc.). BTW, it is free.

The problem with MSComm may be a function of the device driver that was
written for the virtual serial port in use. MSComm uses a "fast-open"
method that can fail under certain circumstances -- though I wouln't have
thought that this was one of them.

I've never seen the sort of thing that you are seeing, so I cannot be sure
exactly what may be happening.

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.
See www.hardandsoftware.net for details and contact information.

Mar 6 '06 #8
Don,

I don't normally suggest this, but if you find out anything, let us know via
a new thread. This one is now old enough that I have to search for it.

Good luck, 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.
See www.hardandsoftware.net for details and contact information.
Mar 7 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Etienne Labuschagne | last post: by
1 post views Thread by Tor Lund | last post: by
3 posts views Thread by Math55 | last post: by
8 posts views Thread by CdiVer | last post: by
1 post views Thread by Reny J Joseph Thuthikattu | last post: by
8 posts views Thread by vicky | last post: by
3 posts views Thread by Nutshell | last post: by
2 posts views Thread by muruganyuva | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.