|
-
Jan 4th, 2009, 09:46 AM
#4
Hyperactive Member
Re: usb i/o communication
Small World! I came to the forum today to ask exactly the question just posted by SGHSGM about interfacing VB6 to USB devices.
As far as I am aware, USB is very similar to RS232 except faster and an extra cable core supplies a limited amount of +5v power to an external USB device. In VB6 the MSCOMM feature provides an excellent 2-way interface to a RS-232 device, but you have to know (or write some code to work out) the COM port no. to which it is plugged. With a USB device, a COM port number is not generated - so MSCOMM could not work with it as is.
I believe that I have seen adaptor devices which plug into a RS-232 9-way and provide a USB connector.Maybe you would need separately to arrange the +5v supply to the USB device. If such adaptors work, it would seem that the USB device would appear as a detectable COM port, and then maybe MSCOMM could talk to it? A good starting point might be a device such as a Garmin GPS receiver head. These are available either as RS-232 or USB connectors, and they usually send data continuously without prompting. There may also be (faster?) usb converters which plug into a 25 way parallel port if you still have one of these. In all cases you would, as above advised, need the manufacturer's spec. as to message formats, parity etc. etc.
If you have a program or driver with the USB device, it may be possible to run that program through VB6 using appactivate and / or keystroke and thus to get data into or out of the VB6 program. But it would be so much better if there were an equivalent of MSCOMM for USB devices.
Increasingly external devices have the USB interface, so it is increasingly a significant shortcoming of VB6 that it does not have a USB interfacing routine / control available. I wonder if any later version of VB contains such a beast?
I will be very interested to see what other replies are submitted to this thread. Surely many VB6 users have asked just this question and tried to answer it?
camoore
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|