Need help in developing a VB app about USB hub!

I'm developing an application in VB 6.0, where I have to communicate with a device site in a USB port, but I don't know how open, write, read, and close this port in VB. If someone know how do it, or has sample code, I was very gratefull. Thank you very much!

Best Regards

[276 byte] By [andresdela] at [2007-12-28]
# 1

Here is the info I managed to find on this topic:
-
How an application accesses a USB device depends on what device driver
Windows has assigned to the device. For example, if the device is a
disk drive, applications can access it like any other drive. They
don't have to know or care whether the drive has a USB or other
interface. It's all handled at a lower level.

Some devices use custom drivers, so to access them you need
documentation for the driver. A typical driver uses CreateFile, then
some combination of ReadFile, WriteFile, and DeviceIOControl API
calls.

If you're developing your own USB device for low/moderate speed I/O,
the human interface device (HID) drivers built into Win9x/2k are an
option. I have example VB code and firmware for HIDs on my USB page:
http://www.lvr.com/usb.htm

Jan Axelson
http://www.lvr.com
-

Regards,
Vikram

Vikram at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
I have a USB GSM modem device, and I have to open USB port where the device is, and send some AT commands. In PCMCIA slot (serial ports) I used MSComm to work with ports, in this case can I use MSComm to work with USB port?
andresdela at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
Because it is a modem, the device driver should/maybe provide a virtual com port to access the device, kind of like a pci modem. Look through the device's properties in device manager, hopefully you should see the port name.
KennethMitchell at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
I want to create application that like peer-to-peer using USB. I have 2 USB ports and want to communicate. You see that the hyperterminal doesn't support for USB port, it only support COM and TCP/IP. How can I use the terminal, or there any other terminal that support USB (I prefer don't use serial converter, because the implementation will use USB to USB). Or can we configure one USB port as COM port.

PS: USB port I mean is the port that exist on computer.

Thanks.

AristonDarmayuda at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
Thanks alot
AmrOuf at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 6

hi

we're developing an application using VB 6.0 regarding USB hub. the hub has 4 usb port. we're having a problem in ejecting the USB connection.once the button on the VB app is pressed, the connection on the app and also into the computer should be safely removed. we don't know how to implement that. help?

anjgel at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 7

I'm not sure you actually want to do this.

You cannot directly connect two computers by a USB cable (even though A-A cables do exist). Doing so could cause hardware damage, because both PCs will be trying to supply power to the USB bus. There will almost certainly be a small voltage difference between the two, and with virtually zero resistance in your USB cable, there will be a large current flow.

You could cut the power wires and connect only the signal wires, but that still won't get you anywhere, because both PCs are USB masters.

So you would need a USB device to sit in the middle, and act as a slave to both computers, and route requests between them. I'm not aware of any such commercially-available device. You could likely build it, but assuming that you have Ethernet available, why bother?

-- graham

Graham at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 8

I think you need a special cable to communicate pc to pc over USB (Analogous to an Ethernet cross-over cable).

Look to http://www.ramelectronics.net/html/usb_smartnet_cables.html they should be able to help.

JohnNawrocki at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...