Problem using serial port in vb2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan

    #1

    Problem using serial port in vb2005

    Hello,

    I want to send some simple strings to com1 using vb2005. I want to read it
    in Hyperterminal.
    I succeeded to send some data en read it in Hyperterminal, only the data I
    received is not the data I send.

    This is the code i used:

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    SendSerialData( )
    End Sub

    Sub SendSerialData( )
    Dim data As String = "x"

    ' Send strings to a serial port.
    Using com1 As IO.Ports.Serial Port =
    My.Computer.Por ts.OpenSerialPo rt("COM1", 2400, IO.Ports.Parity .None, 8, 1)

    com1.WriteLine( data)
    End Using
    End Sub

    Is there something I forgot?
    The settings of the serial port I also used for hyperterminal.

    Thank you very much for even reading my question
  • Chris Dunaway

    #2
    Re: Problem using serial port in vb2005

    Jan wrote:
    I want to send some simple strings to com1 using vb2005. I want to read it
    in Hyperterminal.
    I succeeded to send some data en read it in Hyperterminal, only the data I
    received is not the data I send.
    >
    You will have to be more specific about what went wrong. How is the
    data you received different than what you sent? Is it *completely*
    different? Or are you just missing some information?

    You said the settings in Hyperterminal and the serial port were the
    same. Are you using the same handshaking? Is it hardware handshaking
    or are you using XOn/XOff? How much data are you sending?

    Chris

    Comment

    Working...