CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 1999
    Location
    Iceland
    Posts
    10

    Using Serialports

    Hello People

    I am trying to send something trough a serial port, I have tried few methods to send to the port (use Create file and Write file, MsComm in VB and even tried to send with Hiperterminal) and few methods to receive the message (Hiperterminal, CreateFile+ReadFile and MSComm) and nothing has gotten trough.

    I have no been able to send anything trough.

    I tried another cable that I know that works but no result.

    And I tried it on another computer to se if the serial ports on my computer were broken or something wrong with them and no result.

    Most of this time I have been trying this I just connected Serialport 1 with Serialport 2 and I thougt mabe that did not work? But I tried it with another computer with out result.

    So I am going insain here so any help would be mostly thankfull, or just send me some prosac!

    Thanks in advance.

    Bjarki




  2. #2
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Using Serialports

    I have 4 projects that might help you. Post your email if you want to CodeGuru and I'll send them to you...
    I have also a little experience with that. But only a little... ;-)

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  3. #3
    Join Date
    Dec 1999
    Location
    Iceland
    Posts
    10

    E-Mail

    [email protected]

    Thank You


  4. #4
    Join Date
    Oct 1999
    Location
    UK
    Posts
    44

    Re: Using Serialports

    Firstly, make sure you have the correct cable for the job! If you can't make Hyperterminal work from Com1 to Com2, this is probably the cause.

    Unless you are connecting to a modem or printer, which are both DCE (Data Comms Equipment), you almost certainly require a null-modem cable to allow you to link two DTE (Data Terminal Equipment). Otherwise, for example, the transmit pin from Com1 will be connected to the transmit pin of Com2, which cannot work! You need to join Com1 TXD to Com2 RXD, etc.

    A basic connection can be made with a simple 3-wire cable using RxD, TxD and ground. If you want to use hardware handshaking (preferred), all wires should be connected.

    Get your Hyperterminal link working with this cable, then test you own code, knowing that this is the only thing under test.

    See the following websites for pinouts of both 9 and 25 way null modem connections:
    http://www.pcconnet.com/serial.htm
    http://www.systime.com/technotes/nullmodem.htm


    Mark
    Regards

    Mark Rivers-Moore

  5. #5
    Join Date
    Jul 2000
    Posts
    1

    Re: Using Serialports (in VB)

    I fall into the anguish of despair that same to “Bjarki’s Using serial port”.
    My email address : [email protected]

    “Bjarki’s Using serial port”
    I am trying to send something trough a serial port, I have tried few methods to send to the port (use Create file and Write file, MsComm in VB and even tried to send with Hiperterminal) and few methods to receive the message (Hiperterminal, CreateFile+ReadFile and MSComm) and nothing has gotten trough.
    I have no been able to send anything trough.
    I tried another cable that I know that works but no result.
    And I tried it on another computer to se if the serial ports on my computer were broken or something wrong with them and no result.
    Most of this time I have been trying this I just connected Serialport 1 with Serialport 2 and I thougt mabe that did not work? But I tried it with another computer with out result.


    Thanks in advance.



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