Serial Communication Problem

Discussion in 'C++' started by mrx3cas, Jul 2, 2010.

  1. mrx3cas

    mrx3cas New Member

    Joined:
    Jul 2, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,


    For the purpose of serial communication I am created two applications in vb6.0 and I am used SaxComm control for this purpose.

    I am deployed both applications in two different pcs and both pcs are connected with null modem cable.


    I want to assign the data entered in the text box of first application to the text box of second application.


    From the first application I am sending data using the following code to write data to a serial port.

    SaxComm1.output=Text1.Text 'Name of the text box is Text1

    I am receiving data in the second application like below.

    In the receive event of SaxComm control I am written the following code for the purpose of receiving data.

    I tried this in two ways.

    First Way
    -------------

    SaxComm1.InputMode = comInputModeBinary
    Dim Buffer() As Byte
    ReDim Buffer(SaxComm1.InBufferCount - 1)
    Buffer = SaxComm1.Input
    MsgBox (Buffer)
    Dim I As Integer
    For I = 0 To UBound(Buffer) - 1
    Text1.SelText = str(Buffer(I))
    Next I

    Second Way
    ----------------

    SaxComm1.InputMode = comInputModeText
    Dim str As String
    SaxComm1.InputLen = 0
    str = SaxComm1.Input
    Text1.Text =str

    when I want to assign it text box the data is not coming properly as how I am entered in the first system.


    in the first way when I entered HI it shown the data in the text box as 84.

    in the second way nothing is showing in the text box.

    I kept watch on str. the value of str is shown as like below


    "€€"


    what is the problem exactly and can anybody tell me what modification i need to do if I want to assign the text what I entered in the first application as its in the text box of second application??

    when I used MSComm32 control I am able to do the same thing.I am getting issue with SaxComm control only.

    Thanks in advance.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice