Go Back  Xtreme Visual Basic Talk > General Discussion > Tech Discussions > Control A USB Port Device

Thread Tools Display Modes
Old 11-18-2008, 01:54 PM
The_Programmer The_Programmer is offline
Join Date: Nov 2008
Posts: 2
Smile Control A USB Port Device

Hello Everybody i want to create a program to let me have the ability to control a USB device such as ( A motor or a LED etc.. . )
If anyone can help i appreciate very much.
Reply With Quote
Old 11-18-2008, 05:46 PM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,399

If someone creates a "USB motor/LED" product they must make it appear to Windows as some standard device type or provide drivers and an API if it is to be a custom device.

Think of USB the way you think of PCI, AGP, ISA, ATA, etc. slots. You don't control the slots, you control the devices plugged in. In other words there is no such thing as generic use of the USB Host Adapter. It is nothing like COMn: ports in its nature or intended use. It is an expansion port.
Reply With Quote
Old 11-19-2008, 12:10 AM
The_Programmer The_Programmer is offline
Join Date: Nov 2008
Posts: 2

Thanks For your Reply, But as i understood we cant do this through a USB Port.
Ok If I want to do so through a COM port is that possible? And how?
The way i want to control this device is through a visual basic 6.0 program, but how to create this program.
If anyone can help Please.

Last edited by The_Programmer; 11-19-2008 at 12:49 AM.
Reply With Quote
Old 11-19-2008, 06:30 AM
darkforcesjedi's Avatar
darkforcesjedi darkforcesjedi is offline
Trust me, I'm an

* Expert *
Join Date: Apr 2001
Location: In ur base, pwnin d00dz
Posts: 1,964

VB doesn't natively support Parallel or COM communications, but if you get yourself WIN95IO.DLL, it has the functions vbIn and vbOut which enable this. (InpOut32.dll works as well)

How you operate an attached device depends entirely on how it's designed. You can create a circuit directly connecting an LED and a resister between one of the +5V data pins and the ground. Switching the data pin on and off would turn the LED on and off.
To err is human; to debug, divine.
Reply With Quote
Old 11-19-2008, 07:19 AM
mkaras's Avatar
mkaras mkaras is offline
Ultimate Contributor

Retired Leader
* Expert *
Join Date: Mar 2004
Location: Beaverton, OR
Posts: 1,874

There are many many "devices" that connect to a computer via the USB interconnection system. You (i.e. TheProgrammer) have not focused in on the specific device so it would appear that you are trying to comprehend how you may control a 'generic' device through a USB connection. In the general case it is necessary to design up the hardware and write the software for both ends to get a USB device operational or get a ready made device where someone else has already done the work for you. Now all that said there are a fair number of USB devices out in the market that provide some of the PC to target interface by providing the USB connection for you and then you can provide the adaption on the target end of the thing to get the device attached to your specific end hardware/device. Here are some examples of some of these interface connectivity solutions....











Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..