发表于:2002/4/8 9:52:00
#0楼
我用vb编的程序,为什么返回是乱码?
Dim strSend As String
Dim strReceive As String
If MSComm1.PortOpen = False Then
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,7,1"
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeText
MSComm1.RThreshold = 0
MSComm1.PortOpen = True
End If
strSend = "0500FF00204ABCD34"
MSComm1.Output = strSend
Do
DoEvents
Loop Until MSComm1.InBufferCount >= 10
strReceive = MSComm1.Input
Text1.Text = strReceive
Dim strSend As String
Dim strReceive As String
If MSComm1.PortOpen = False Then
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,7,1"
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeText
MSComm1.RThreshold = 0
MSComm1.PortOpen = True
End If
strSend = "0500FF00204ABCD34"
MSComm1.Output = strSend
Do
DoEvents
Loop Until MSComm1.InBufferCount >= 10
strReceive = MSComm1.Input
Text1.Text = strReceive