Private Sub cmdM_Click()
UartCom.InBufferCount = 0
UartCom.Output = Chr(65) 'display A
UartCom.InputLen = 1
S = ""
On Error Resume Next
Do
dummy = DoEvents()
'If there is data in the buffer, then read it.
If UartCom.InBufferCount Then
S = S + UartCom.Input
Exit Do
End If
Loop Label1.Caption = S
End Sub
Private Sub cmdM_Click()
UartCom.InBufferCount = 0
UartCom.Output = Chr(66) 'display B
UartCom.InputLen = 1
S = ""
On Error Resume Next
Do
dummy = DoEvents()
'If there is data in the buffer, then read it.
If UartCom.InBufferCount Then
S = S + UartCom.Input
Exit Do
End If
Loop Label1.Caption = S
End Sub
Private Sub Form_Load()
'setting serial
UartCom.CommPort = 1
UartCom.Settings = "9600" & "M" & ",8,1"
UartCom.PortOpen = True
End Sub