I am tring to commuicate with a cm11a (x10) unit. I am to send it two bytes (test) and then it sends me back the checksum of those. But I can't figure out how to compare the data sent back from the cm11a to get it to then close the port.
TIA
Private Sub Command1_Click()
Dim test
Dim Buffer$
test = Chr(&H4) + Chr(&H66)
Dim Instring As String
MSComm1.CommPort = 1
MSComm1.Settings = "4800,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.Output = test
Do
DoEvents
Buffer$ = Buffer$ & MSComm1.Input
****Here is my problem area********************
Loop Until InStr(Buffer$, ?????????)
'Read the "6A" response data in the serial port.
' Close the serial port if "6A".
************************************************
MSComm1.PortOpen = False
End Sub
TIA
Private Sub Command1_Click()
Dim test
Dim Buffer$
test = Chr(&H4) + Chr(&H66)
Dim Instring As String
MSComm1.CommPort = 1
MSComm1.Settings = "4800,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.Output = test
Do
DoEvents
Buffer$ = Buffer$ & MSComm1.Input
****Here is my problem area********************
Loop Until InStr(Buffer$, ?????????)
'Read the "6A" response data in the serial port.
' Close the serial port if "6A".
************************************************
MSComm1.PortOpen = False
End Sub