mscomm控件(接收的字符少于发送的字符)(在线等)
单步调式的时候接收的字符数和发送的字符数是一致的。但是一旦程序运行,
则接收的字符数就少于发送的字符数。有时接收的字符串为空。望高手不吝赐教。
示例:
Private Sub Command1_Click()
Dim str As String
MSComm1.CommPort = 1
If Me.MSComm1.PortOpen = False Then
Me.MSComm1.Settings = "115200,n,8,1"
Me.MSComm1.PortOpen = True
End If
MSComm1.Output = "user=admin password=pass" & vbCr
MSComm1.Output = "get hsb.ini" & vbCr
Me.Text1.Text = Me.MSComm1.Input
End Sub
Me.Text1.Text 本应接受的字符串应该为[Home]
HsbUserID=hsb ProductID= HsbVersion= HsbType=1 NetworkType=0 IP=192.168.20.223 NETMASK=255.255.224.0 GATEWAY=192.168.10.254 DNS1=192.168.10.254 DNS2= BaudRate=
但是程序运行的时候有时候得到的是字符“Rate=”有时候就为空 请问是何原因?