
problems with read data from serial port
Hi All
I am a newbie in VB
I want to read from the serial port which is connected through a null -
modem cable to other computer, On the second computer is running Com Port
ToolKit which send string.
I use for reading the following code taken from Help VB6
Private Sub Command1_Click()
Dim Buffer as Variant
Dim Arr() as Byte
' Set and open port
MSComm1.CommPort = 1
MSComm1.PortOpen = True
' Set InputMode to read binary data
MSComm1.InputMode = comInputModeBinary
' Wait until 10 bytes are in the input buffer
Do Until MSComm1.InBufferCount < 10
DoEvents
Loop
' Store binary data in buffer
Buffer = MSComm1.Input
' Assign to byte array for processing
Arr = Buffer
Print "Buffer=", Buffer ' Added by Boris
End Sub
I receive nothing through PRINT, except Buffer =
From the same computer I send from VB program through the same null - modem
cable to the second computer with Com Port ToolKit and receive it
Please help
Boris