Results 1 to 2 of 2

Thread: serial communication problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    serial communication problem

    excuse me, i am not very familiar with the concept of active x.
    if by using vb6, i want to send command to my microprocessor,
    let say if i press command button 1, this command will be sent to com port 2. and my microprocessor takes command from serial port to activate my output.

    is there anything wrong with my source code??

    Private Sun Form_Load()
    With MSComm1
    .CommPort=2
    .Settings="9600,N,8,1"
    .PortOpen=True]
    End With
    End Sub

    Private Sub btnSend1_Click()
    MSComm1.Output=txtSend.Text
    End Sub

    Private Sub btnSend2_Click()
    MSComm1.Output=txtSend.Text
    End Sub

    Private Sub btnSend3_Click()
    MSComm1.Output=txtSend.Text
    End Sub

    Private Sub btnSend4_Click()
    MSComm1.Output=txtSend.Text
    End Sub


    Thanks.

  2. #2
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: serial communication problem

    .PortOpen=True] without a "]".
    In principle the code is OK. Take a look at the handshaking of your comm-port. For testing connect CTS-RTS together and DTR-DSR-DCD together.
    Set: “MSComm1.Handshaking=comNone”
    After these tests enable the handshaking with your microprocessor.

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