Re: Talking to USB

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Don (phoney.email_at_yahoo.com)
Date: 11/27/04


Date: Sat, 27 Nov 2004 13:58:20 GMT

Hi Richard,

Actually (and unfortunately) it's none of the above. It's a scanner.

Which APIs should I use to talk to a USB scanner from VB6?

Please note that I intentionally need to bypass TWAIN and talk to the
scanner directly!

To be more specific I need to send (scanner) command bytes to the
device and then receive status bytes back. And, of course, receive
image data once the actual scan commences.

TWAIN is far too high level for this and limits access to standard
TWAIN command set, while I wish to use other commands the device is
capable of.

Don.

On Fri, 26 Nov 2004 11:35:44 -0700, "Dick Grier"
<dick_grierNOSPAM@msn.com> wrote:

>Hi,
>
>You normally use whatever API is required for the specific hardware device
>that is attached to the USB port. There is no general-purpose driver for
>this. So, if you are connecting to a serial device, you use the Windows
>serial APIs. If a sound device, you use the MCI APIs. If a disk drive, you
>use the various file APIs. The actual driver that is installed when Windows
>detects the USB device translates these Windows APIs to the device specific
>commands required for the actual hardware.
>
>However, if you have custom built USB hardware, you need lower level access
>to the device. You must know A LOT about the hardware before this sort of
>thing is useful. I suggest that you get a copy of Jan Axelson's book, USB
>Complete, 2nd Edition. You can get information on it from the Books link on
>my homepage.
>
>If you just want to use a USB serial port adapter to connect to an RS-232
>device, then you may use MSComm or any of the other serial communications
>methods that are described in detail in my book.
>
>--
>Richard Grier (Microsoft Visual Basic MVP)
>
>See www.hardandsoftware.net for contact information.
>
>Author of Visual Basic Programmer's Guide to Serial Communications, 4th
>Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
>www.mabry.com/vbpgser4 to order.
>
>



Relevant Pages

  • Re: Need to get info from USB
    ... You normally use whatever API is required for the specific hardware device ... that is attached to the USB port. ... So, if you are connecting to a serial device, you use the Windows ... you use the MCI APIs. ...
    (microsoft.public.vb.com)
  • Re: USB Control available?
    ... You normally use whatever API is required for the specific hardware device ... that is attached to the USB port. ... So, if you are connecting to a serial device, you use the Windows ... you use the MCI APIs. ...
    (microsoft.public.vb.controls)
  • Re: USB-devices.
    ... You normally use whatever API is required for the specific hardware device ... that is attached to the USB port. ... So, if you are connecting to a serial device, you use the Windows ... you use the MCI APIs. ...
    (microsoft.public.vb.winapi)
  • Re: Capture data from a USB Port
    ... You normally use whatever API is required for the specific hardware device ... that is attached to the USB port. ... So, if you are connecting to a serial device, you use the Windows ... you use the MCI APIs. ...
    (microsoft.public.vb.general.discussion)
  • Re: USB into Visual Basic 6
    ... You normally use whatever API is required for the specific hardware device ... that is attached to the USB port. ... you use the MCI APIs. ...
    (microsoft.public.vb.controls)