Results 1 to 5 of 5

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

  1. #1
    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?

  2. #2
    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/

  3. #3
    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.

  4. #4
    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!

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    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

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2011, 04:46 AM
  2. How to Communicate with other Applets?
    By PsYcHo 1 in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 04:17 AM
  3. Could not communicate with gps on HTC Sprint
    By Markesh in forum Portable Devices
    Replies: 2
    Last Post: 28-07-2009, 10:47 AM
  4. cannot communicate with DNS server
    By Pratim in forum Windows Vista Network
    Replies: 2
    Last Post: 18-05-2009, 05:07 PM
  5. Missing port types : local port and Standard TCP/IP port
    By NIcaBoy in forum Windows XP Support
    Replies: 3
    Last Post: 28-12-2006, 07:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,693,057.65685 seconds with 17 queries