Author Topic: How to read from USB port  (Read 13739 times)

NiiDarko

  • Member
  • ***
  • Posts: 1
How to read from USB port
« on: January 04, 2012, 03:08:15 am »
Hi Jan,

I am developing a barcode application for vb6. Can i have code for reading from the USB port.
I have seen the HID source code but i connected my barcode reader and couldnt figure out how it works.

Can you please help me?

Nii

Guido Koerber

  • Frequent Contributor
  • ****
  • Posts: 72
Re: How to read from USB port
« Reply #1 on: January 04, 2012, 11:36:53 am »
You never read or write to or from a USB port, just like you don't do that with an ethernet port. USB communication is between a host and a device. To talk tto your device you have to find out how that device works.

The best starting point would be to have a look at the specification of the device.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to read from USB port
« Reply #2 on: January 04, 2012, 11:50:00 am »
If the reader enumerates as a system keyboard, an application can read the barcodes in the same way as other keypresses. To read from a specific device, use raw input. (Do a web search on raw input for details.)

Jan