Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to communicate with USB port with VB.NET program?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-02-2009
Member
 
Join Date: Jan 2009
Posts: 38
How to communicate with USB port with VB.NET program?
  

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?

Reply With Quote
  #2  
Old 18-02-2009
Member
 
Join Date: Feb 2009
Posts: 7
Re: How to communicate with USB port with VB.NET program?

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/
Reply With Quote
  #3  
Old 18-02-2009
Member
 
Join Date: May 2008
Posts: 44
Re: How to communicate with USB port with VB.NET program?

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.
Reply With Quote
  #4  
Old 18-02-2009
Member
 
Join Date: May 2008
Posts: 35
Re: How to communicate with USB port with VB.NET program?

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!
Reply With Quote
  #5  
Old 18-02-2009
Member
 
Join Date: Apr 2008
Posts: 1,947
Re: How to communicate with USB port with VB.NET program?

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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to communicate with USB port with VB.NET program?"
Thread Thread Starter Forum Replies Last Post
How to Write a program to communicate between two processes using the pipe{ This is urgent so please help me} huyleuit Software Development 1 11-11-2011 03:46 AM
How to Communicate with other Applets? PsYcHo 1 Software Development 4 18-02-2010 03:17 AM
Could not communicate with gps on HTC Sprint Markesh Portable Devices 2 28-07-2009 10:47 AM
cannot communicate with DNS server Pratim Windows Vista Network 2 18-05-2009 05:07 PM
Missing port types : local port and Standard TCP/IP port NIcaBoy Windows XP Support 3 28-12-2006 06:38 PM


All times are GMT +5.5. The time now is 01:18 AM.