How to communicate with USB port with VB.NET program?
I want to know how can i communicate with the USP port of my computer with the application so that i can read or write etc with using this USB port & a device connected to it!
Any help?
How to communicate with USB port with VB.NET program?
I want to know how can i communicate with the USP port of my computer with the application so that i can read or write etc with using this USB port & a device connected to it!
Any help?
Have you tried going through the sample which communicates with the COM Port. You can use the same logic to connect to the USB Ports too.
Take a look at this sample:
http://www.microsoft.com/downloads/d...DisplayLang=en
Here is one more in C#
http://www.icsharpcode.net/opensource/sharpusblib/
There isn't a single method for using USB -- every device provides its own
API. These either are standard Windows APIs, or ones specific to the device
that the device manufacturer provides you. Also, depending what you are communicating with you will need to know the manufacturer's info on the hardware.
One other thing you can do is use a MSDN subscription to get the driver
development kit, so, you can write your own inf files too. Maybe you don't
need the subscription now, but you did 3 years ago when I was doing a lot of
USB/VB programming for different devices.
Hello there I think you need to understand the concept of USB port in VB.net that will enable you to communicate with the device attached to the USB port from your Vb.net application!
http://www.codeproject.com/KB/IP/ser...mmunicate.aspx
I hope this helps you!
I have found that some USB devices not only add themselves as a HID Device (see your Windows Device Manager) but ALSO add themselves as a COM Device (see you Windows Device Manager) a little further down the list under Ports. Note that not all USB device do this it would seem and I am unsure if it is possible to force this.
Upon finding this and which COM port the USB is assigned to you can access the USB device by using standard COM port settings.
Remember to Set a baud rate of 57600 for Bluetooth though.
My code for VB 6.0 is below, there seems to be an abundance of examples on how to get COM port access using .net so I will try that soon.
Code:Private Sub btnexit_Click() End End Sub Private Sub btnReceive_Click() 'rx txtReceive.Text = MSComm1.Input End Sub Private Sub btnSend_Click() 'send MSComm1.Output = txtSend.Text & vbCr End Sub Private Sub Form_Load() ' Config and open the COM port With MSComm1 .CommPort = 6 .Settings = "57600,N,8,1" .PortOpen = True End With End Sub
Bookmarks