USB Communication VB.net
USB Communication VB.net
USB Communication VB.net
USB Communication VB.net
USB Communication VB.net
USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net
USB Communication VB.net USB Communication VB.net
USB Communication VB.net
Go Back  Xtreme Visual Basic Talk > > > USB Communication VB.net


Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2007, 08:41 AM
Glamdring Glamdring is offline
Freshman
 
Join Date: Nov 2006
Posts: 34
Question USB Communication VB.net


Hi,

Can anyone give me any direction/code on how to:

1) Innitiliase
2) Read from
3) Write to

a USB port in VB.net?

I have a bluetooth device connected via USB. This talks to something else which can receive commands and respond back.

The project is simply to

1) Open the USB port, read from it, parse the info and then display the content on a form.

2) Write to the device - simple ascii commands that are sent to the device through the blue tooth device via the USB port.

I think I can code the parser on my own but reading from and writing to the port is where I fall down.

I know that in VB 6.0 you could add a MSSCOMM control and open up an RS232 with a fairly well documented pieve of code but what is the equivalent when dealing with USB?

Can anyone help?

Many thanks.
Reply With Quote
  #2  
Old 06-04-2007, 10:12 AM
Glamdring Glamdring is offline
Freshman
 
Join Date: Nov 2006
Posts: 34
Default

I have found out through seperate enquiries that I must write a device driver for a HID (Human Interface Device)...
Reply With Quote
  #3  
Old 06-07-2007, 06:31 AM
Glamdring Glamdring is offline
Freshman
 
Join Date: Nov 2006
Posts: 34
Thumbs up Solution Found..

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.

************************

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
  #4  
Old 06-24-2007, 04:39 PM
trend trend is offline
Regular
 
Join Date: Aug 2004
Posts: 86
Default

What kind of USB device are you trying to utilize?
__________________
About me: Lee Leathers
Reply With Quote
Reply


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

Advertisement:





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.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
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..
subscribe
USB Communication VB.net
USB Communication VB.net
USB Communication VB.net USB Communication VB.net
USB Communication VB.net
USB Communication VB.net
USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net USB Communication VB.net
USB Communication VB.net
USB Communication VB.net
 
USB Communication VB.net
USB Communication VB.net
 
-->