advertisement
from the Automation List department...
How to configure USB port in Visual Basic
Programming languages. topic
Posted by venkat on 15 October, 2005 - 3:32 pm
Hello friends,
I want to connect USB port using VB How can I do that without using USB to RS232 converter? Can any one help me to know how can I connect USB port. I am using the device which uses data transfer at high speeds which cannot be supported using USB to RS 232 so can you please let me know how I can directly connect to the USB port using my GUI.

Thank you,
mail me back to venkatsubbarao@gmail.com


Posted by Robert Scott on 15 October, 2005 - 8:57 pm
You don't say what USB device you wish to communicate with. The class of that device and the device driver associated with that device will dictate how you can access it in VB.

See the book "USB Complete" by Jan Axelson.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting


Posted by Venkat on 18 October, 2005 - 11:03 am
I m using a Mitshibushi controller which is having USB feature and its belong to communication class. Actually we are developing this device so we have to configure the class in the software in the device side. We are using the driver provided by thesycon for this device


Posted by Dr. R. Erlich on 12 November, 2005 - 12:17 am
VB GUI sample, DLL code and more--

EID, Corp. is an OEM manufacturer (100% made in U.S.A) for many kinds of E-USB boards and kits, such as I/O, ADC, timer, counter, etc. You will be able to control directly from your PC via USB port. Yes, free DLL and other free software...

Write your code, application utilizing our free DLL.

See the following links:

1. Free VB, C++ etc. DLL and demo software E-USB PC-ports kits:

http://www.eidusa.com/Electronics_Kits_EUSB_DLL.htm

http://www.eidusa.com/Electronics_Kits_EUSB_Software.htm

2. Electronic Kit (DIY), I/O and more via E-USB:
http://www.eidusa.com/Electronics_Kits.htm

Regards,

Ron


Posted by Nathan on 17 November, 2005 - 12:13 am
Hello,

I was searching the net for some FAQs on this exact subject so i thought I would jump the band wagon. I am a student and am working on a project at my school that requires me send 4 bit signals to a transmitter. the connection on the transmitter is connected via DB-9 serial, my problem is when I interface with my laptop there is no DB-9 present so i purchased a USB-SERIAL converter. Here is where im lost and i have lost my mind trying to figure this out. I have code written in VB however during the testing phase I wrote the code and tested at my home computer (using the DB-9 serial) and it worked fine. however when i used the adapter (USB) at my school I got all sorts of mscomm port errors. I was told that i had to modify my code to the USB. Any help here would be greatly appreciated.

Nathan


Posted by Starride on 18 November, 2005 - 1:58 am
I have a USB to serial that I bought for 78 bucks from radio shack, been using mine for 2 years now, have not found a thing that it has not worked with and I use mine at least once a week.

They still sell it.


Posted by Nathan on 18 November, 2005 - 11:40 pm
But do you use it for VB 6.0? If so what is the brand maybe I could look for it?

Nathan


Posted by Starride on 22 November, 2005 - 1:56 am
Give me your e-mail address and I will send you some test source code in VB 6.


Posted by eric on 23 November, 2005 - 1:07 pm
hi, i am also looking for VB6 code samples to control a USB-HID device, i would appreciate if you can also send one for me. thanks a lot.
email: ericgmejia@yahoo.com


Posted by nathan on 2 December, 2005 - 12:18 am
Hey Starride,

here it is:
natefajardo@gmail.com

thanks


Posted by Seth Fuller on 25 January, 2006 - 12:39 am
Hey Starride,

Please kindly send the VB6 example USB-Serial code to my email. sfuller94@yahoo.com

Thanks,
Seth


Posted by Akhtar Hussain on 13 December, 2005 - 2:19 am
Dear sir,

Kindly give me the vbcode, how to cofigure USB port. I am using Righttag scanner to read & write data into tag using vbapplication.

Here is my e-mail address:
akhtarrs@gmail.com
thanx.


Posted by Anonymous on 12 March, 2006 - 1:07 pm
Hey Starride,
Please kindly send the VB6 example USB-Serial code to my email. mourad.abdelbaki@wanadoo.fr

Thanks, Mourad


Posted by Anonymous on 5 April, 2006 - 11:49 pm
khalid_hanifm@yahoo.com


Posted by cyborg2g on 18 April, 2006 - 10:00 pm
I am testing printer that hook to USB and I am using Visual Studios 2003. Do you have any code that will help me be able to communicate to these printers using VB or VB.Net. These printers are the ones you see in hospitals that make the id bracelets.

Thanks.


Posted by Anonymous on 14 June, 2006 - 3:30 am
i'm also looking for vb or vb.net code to configure USB port.

pls kindly send the code to my email: algareebnet@yahoo.com

thanks,


Posted by malvika on 28 June, 2006 - 12:03 am
I m working in a manufacturing company. It would be gr8 to have the code in VB 6.0 that configures the USB port. Please send me the code on malvika.joshi@rediffmail.com as soon as possible.

It would be really helpful...
Regards


Posted by Anonymous on 25 April, 2006 - 12:26 am
hey starride, if ur still giving out that source code could you please send it to my email scorpiom84@aol.com?
...I'm working on a senior design project that requires me to take in data from a USB port.


Posted by greg on 23 May, 2006 - 10:49 pm
Hello,

I need also some help with Visual Basic to write USB driver. To be exact I need to send some ASCI strig over USB to another UNIT.

Here is my email: gvgregor@yahoo.com.

Thanks,
Greg


Posted by Mayowa on 28 May, 2006 - 3:53 pm
Please Starride can I still have the test code for USB in VB6. Thank you. email addy is mawobadejo@gmail.com


Posted by Anonymous on 11 August, 2006 - 10:57 pm
plz five me the usb source code in vb 6. i really need it. this is my e-mail: saikoy@gmail.com


Posted by Quinh on 18 September, 2006 - 10:34 pm
Hi Starride,

pls send me your source codes in VB6 or VB.NET. My mail: quinhngoc@yahoo.com

Thanks.


Posted by Anonymous on 24 April, 2007 - 1:27 am
If you have a code for connecting a scanner to VB or VB.net, please send it, I will grateful to you.


Posted by Anonymous on 31 May, 2007 - 1:53 am
I'm a Spanish student. I'm investigating about connection USB with VB 6.0. Until now, in my view, the device and the conection type are not specifices (serial, bluetooth...).

If somebody has code for connecting some device with VB 6.0, please send it, I will be grateful to you.
potypoty55 @ yahoo. es


Posted by Paul on 14 December, 2006 - 9:26 pm
Hi,

Could you please also send me details of the USB-Serial interface and VB source code?

Thanks,
kathymay@ozemail.com.au


Posted by Anonymous on 4 January, 2007 - 11:09 pm
I would be interested in your visual basic code, if you are still giving it out. My email is andy @ egl-neon. com. Thank you.


Posted by Anonymous on 27 January, 2007 - 1:07 am
I would be interested in your visual basic code, if you are still giving it out. My email is KandM3301 at midsouth. rr.com. Thank you.


Posted by Anonymous on 23 February, 2007 - 12:26 am
Hello!

I'm a student, and a need this code to conect and control a usb-bluetooth on vb6. Can you send me this code, please? Thank you very very very mch.

nonoweb20@hotmail.com


Posted by nisa on 18 March, 2009 - 10:42 pm
I also need the code to connect usb bluetooth on vb6.thanks

kyun_0666@yahoo.com


Posted by moosty on 20 March, 2009 - 5:53 am
Hi Nisa,

USB - bluetooth devices are used as same as a serial port when you install your bluetooth device drivers.

So you can use it via MSComm (MSComm32.ocx) component with Visual Basic, it is not different than an ordinary RS232 port.

However, some bluetooth device drivers add two serial ports at the same time, one is used for sending and the other is used for receiving but it is a rare situation; most of the devices do receiving and sending in same serial port.

Hope this helps.
---
http://indanotes.blogspot.com
Industrial Automation Notes: A blog about PC managed automation systems.


Posted by aaa on 25 October, 2007 - 9:57 pm
Please send me
farzadmn2 @ yahoo. com


Posted by Sami Salah on 2 February, 2009 - 1:41 pm
Also when I used searching Engine for the same titles I found this which is more more important for me, please send me this code for configuring the USB port through VB6


Posted by Doken13 on 22 July, 2009 - 7:06 am
>Give me your e-mail address and I will send you some test source code in VB 6. <

I create a project in vb.net 2008 and I'd like a help with configure a USB port.

My email is astef31 [at] hotmail.com


Posted by keval on 15 August, 2009 - 7:24 am
pls give me fast vb code if u have vb 205 usb code so please send to me.

keval_savanim [at] hotmail.com


Posted by Grace on 29 September, 2011 - 8:58 am
this is my email address bratinella_mariz@yahoo.com.ph

>Give me your e-mail address and I will
>send you some test source code in VB 6.


Posted by shan on 11 April, 2012 - 12:37 pm
To Starride and those who can help me,

I 'm a student and I want to connect USB port using VB or VC++ with parallel port or serial port to control devices. I am using windows 7 64 bit and facing problem now.

How can I do?
Where can I find dll files and mscomm ... to help me?

Please kindly send the VB6 example USB-Serial code to my email
My email is : hshanshan90@gmail.com
PLEASE


Posted by Ken E on 11 April, 2012 - 1:34 pm
Oh how old threads die a long slow death...

KEJR


Posted by Anonymous on 16 January, 2006 - 5:26 pm
MSCOMM must have pin 1 of the DB9 serial point at a high level or it will not initialize. Dumb limitation but a fact to deal with.


Posted by Bob on 29 May, 2006 - 9:54 pm
Hello,
I dont think you need to change your code, this is a similar problem i had while communicating with a PLC.

The serial converter sets itself up (with the help of the driver) as a standard com port.
So you need to go into control panel/system/ports and check which port it has assigned for the adapter eg com1/com2 etc.then you can set up your mscomm port settint to the correct port value.Beware if you have more than one USB port and you plug your serial adapter into a different one the computer will re assign a new com port number.

hope this helps
Bob


Posted by Anonymous on 2 August, 2006 - 9:55 am
Hello!

I 'm a student and I want to connect the PPC to other device (such as microcontroller) across USB port. Hence i need some help.

pls kindly send the source code to my email: wing.ho@student.adelaide.edu.au

Thank you very much!


Posted by javadarefi on 10 August, 2006 - 11:52 am
Hi
If you want to connect your PC to microcontroller through USB port,your microcontroller must have USB port or you have to buy additional IC that convert USB to serial.
For example you can check http://www.ftdi.com and search for ft232bm. It is USB to RS232 convertor.

I you have any problem you can mail to me.
javadarefi@yahoo.com


Posted by Amer on 24 June, 2010 - 4:51 am
Hello,

I have interface with 24 I/O contact to the PC through USB and I want to use this interface to control 24 LED by switch ON/OFF each one separately. So, I will be so grateful to you if you can help me by send me any code in VB to do that.
Thanks in advance
Please send your answer to my email:amer_qassaim75@yahoo.com


Posted by Robert J Reeder on 11 March, 2011 - 9:00 am
I use RS232-USB devices all the time.

MAKE SURE YOU GROUND THE COMPUTER TO THE DEVICE.

In a couple cases, I had to run a ground wire from the 15 pin video outlet across to the RS232 device. If the Ground is allowed to 'float', USB operation will be intermittent.

Rob


Posted by Nathan Boeger on 12 March, 2011 - 4:21 am
> I use RS232-USB devices all the time.

Could you explain how you do this in a little more detail? Thanks,

----
Nathan Boeger
http://notanotherindustrialblog.blogspot.com


Posted by Sarim Khan on 16 June, 2009 - 9:30 pm
I am a visual basic programmer. I used parallel port for sending and receiving data between PC and hardware. Now I want to use USB port to send and receive data. Can anyone send me the code and how to build hardware for usb?

my email is sarim2005@gmail.com
thanking,
sarim


Posted by loic on 22 February, 2006 - 12:23 am
Hello,

I 'm a student and I want to connect USB port using VB or VC++ with a full speed rate. How can I do? Where can I fing dll files... to help me?

Thank you,
mail me back to loic.baglin@gmail.com


Posted by Anonymous on 16 August, 2007 - 11:20 pm
Hi,

I'm also doing some testing that access to USB port. Is there anyone who has the VB code for this? Please forward it to me at cool_y2@yahoo.com

Thank you very much.


Posted by Rania Ahmed on 24 September, 2007 - 11:45 pm
Hi,

I'm working on my thesis, and I'm in bad need to the VB6 source code to access the USB port for a custom device (FPGA developed USB device), and also for a printer that I'm having some problems to deal with.
I do appreciate it if you can send me this code.
rania_a7mad@yahoo.com or rania_a7mad@hotmail.com

Thank you very much! :)


Posted by Brian U on 7 November, 2007 - 8:29 pm
Bob (on this thread) had the best advice... If you're converting from USB to serial device (i.e. newer laptop/PC to older device), you must have a USB to serial cable, install the drivers that come with it; reboot your pc; plug in the USB cable (doesn't have to be connected to device on other end); go to Control Panel, "Ports" to confirm it's now enabled in Windows and to see which Comm port it is now - mine was Comm 4. Finally, go to the VB code and edit it to find Comm 4. In my case, the code was originally, "MSComm1.CommPort = 1" I simply had to change it to "MSComm1.CommPort = 4".

Hope this helps.


Posted by Anonymous on 15 November, 2007 - 2:12 pm
Hi,

I'm doing the same you did. If you had some news can you forward to me at marchesani.enrico @ libero. it?

Thank You.


Posted by Roxanne on 19 January, 2008 - 12:29 am
Hi,

I'm working on a thesis where my microcontroller sends data vis serial, but I have to use USB to connect it up to my computer. I would really appreciate it if someone could send me the code that was discussed above to my email.

r. panthaky @ hotmail. com

Thank you so much.


Posted by anonymous on 11 March, 2008 - 12:18 am
Hi,

I am working in communicating a Thrustmaster joypad with B to control servos. If anyone could pass me some code, I would be very grateful.

manin1952 @ hotmail. com

Thanks.


Posted by Adison on 1 May, 2008 - 12:52 am
Hi all,

Please can anyone send me some code for controling the USB port using VB.NET? Send them to: t_adison @ Hotmail. com

I will need to control my USB port in my project, so I am doing some research to obtaine some code but it sucks!

Any help?

Thank you very much.


Posted by kavya on 20 May, 2008 - 11:38 pm
Hi all,

Can you forward the VB6 code and details regarding that to me also? I am doing a project where I have to send data to a kit via USB port from the GUI.

Therefore I need this code. My id is kollu. kavya @ gmail. com


Posted by Anonymous on 5 June, 2008 - 12:31 am
Hi,

Can you forward to me the code too...

heero06 @ gmail. com


Posted by Ashkan on 11 January, 2010 - 8:59 am
Hi ,
Can I have the copy OF VB source please .
Thanks in advance.
Ashkan Golestani

ashkan.golestani [at] metrix1.com


Posted by Ravi on 11 October, 2008 - 8:22 pm
I had similar requirement and the following is what I did:
a) downloaded a VIRTUAL SERIAL PORT (VSP) from FTDI and installed on the PC (http://www.ftdichip.com/Drivers/VCP.htm).

b) Then, when you connect the USB instrument, I noticed an added COM port in the SYSTEM (COM7 in my case).

c) I, then, used MSCOMM1 in VB6 to communicate to the device.


Posted by Romulo Rodriguez on 12 October, 2008 - 7:36 am
I would use Python and PyUSB instead.

Romulo Rodriguez


Posted by Lim Choon Kiat on 20 October, 2008 - 12:08 am
Hi there,

I went to the site to download driver version 2.04.06. (It comes with the file "CDM 2.04.06")

However, when I run that file on my XP box, nothing seem to happen. What did I do wrong? (Or is there any configuration I need to do?) Please advise me.

You may email me: limchoonkiat at live. com

Thanks.


Posted by Jason on 8 March, 2010 - 2:52 pm
I have done the same thing but i am using VisualStudio 2008 and i can't seem to find a way to use MSComm. Any ideas?


Posted by Phil on 2 April, 2010 - 6:23 pm
> I have done the same thing but i am using VisualStudio 2008 and i can't seem to find a way to use MSComm. Any ideas? <

VS2005/2008 no longer uses MSComm, you need to reference System.IO.Ports. From there you will have access to the SerialPort object.


Posted by Mohamed Haseel on 24 February, 2011 - 10:57 am
i'm also in the same problem that i don have a rs232 port on my lap. so i purchased a usb to rs232 converter. but since i've programmed using vb6.0 for my rs232 port, i need them to be converted for the new converter that connects using usb port.

please send solutions if any to my email.. mail:haseel2004@gmail.com


Posted by Carina on 5 April, 2011 - 9:10 am
I'm also having some problems with configuring the usb port in VB. Could you please send me some source codes showing how to do it.

My e-mail is carina_timao@yahoo.com.br


Posted by simplicio on 4 May, 2011 - 6:10 pm
Please visit: http://www.USBHidNetClass.org.

Interface WindForms USB Control for Visual C# and VisualBASIC.NET to connect with microcontroller.

simplicio

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2014 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
Vote anarchist
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive