CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2011
    Posts
    1

    Question Serial Port Interfacing

    Hi every one!
    Actually i want to drive a LED Display.

    I want to send data through serial port COM1. I develop my application using VB 6.0 but there is a
    problem and that is, when ever i try to send data to COM1, the VB also sends a lot of some synchronization bits or may some thing else. Therefore the display module displays some garbage.
    I want the solution, can somebody help me in this regards. please....

    Thnx in advance!

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Serial Port Interfacing

    Okay so how are you opening the Com Port?? what type of LED Display is it? post the offending code so we can debug it for you..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Serial Port Interfacing

    If you are seeing garbage it is likely that your port settings are incorrect. Baud rate. Parity, data bits and stop bits must match on both sides, VB adds nothing to a com string. You should receive exactly what you send if your settings match. Otherwise the receiver will be unable to decode the tranmission and will result in garbage.

    In other words if your LED panel is set for 9600, n, 8,1 then your comm control must also be set to 9600, n,8,1
    Last edited by DataMiser; May 29th, 2011 at 09:14 AM.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    May 2011
    Posts
    6

    Re: Serial Port Interfacing

    DataMiser is 100% correct.
    before you write any program in VB, use null modem to connect two serial ports (can be on different PCs if you like) and configure ports (use hyperterminal or whatever you use). you will quickly see that you only get correct signal if baud rate, parity, etc. all match.
    note, unless you have fully wired cable, do not select hardware handshaking.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured