Serial Port Sample Code Needed for Visual Studio 2005 & Visual Basic

Hello All,

I am an Electrician that uses Micro-Controllers in my work and only 1 - week old in VB programming. I have been able to build a Windows interface and perform several task in Visual Basic using Visual Studio 2005 Standard Edition but Completely Lost in using my USB port. I would like to start out Very Simple and simply press a button to send a byte of data out the port. If anyone could assist me in a very simple code sample I would be gratefull. I have read sample code in books and posted on the internet but without much luck on having anything work. I have installed the Serial port in my project that comes in the Visual Studio 2005 toolbox and have set the parameters as nessessary but pretty much Lost from there.

Sincerely,

JML



Answer this question

Serial Port Sample Code Needed for Visual Studio 2005 & Visual Basic

  • jaspi

    Hi,

    The serial port is not the same as the USB port. You won't be able to use the serial port code to access the USB port. Here is a USB addin for C#.NET...

    http://www.icsharpcode.net/OpenSource/SharpUSBLib/default.aspx

    There could be another similar third party control for VB.NET.



  • JayaK

    Hi again,

    If the USB device is recognised by Windows as a hard drive, which most are, then you can write data to the device using normal file IO.

    Just curious what are you doing with the USB port as I've been wondering how to use it myself.



  • Serial Port Sample Code Needed for Visual Studio 2005 & Visual Basic