我有如下程序:
Private Sub sub_addinit()
    If MSComm1.PortOpen = False Then
        MSComm1.CommPort = 1                 
        MSComm1.Settings = "9600,N,8,1"  
        MSComm1.PortOpen = True         
        MSComm1.InputMode = comInputModeText
        MSComm1.Handshaking = comRTSXOnXOff
        MSComm1.RThreshold = 1
        MSComm1.InBufferCount = 0
        MSComm1.OutBufferCount = 0
        MSComm1.InputLen = 16
        Else
MSComm1.PortOpen = False
MSComm1.CommPort = 1               
MSComm1.Settings = "9600,N,8,1"    
MSComm1.PortOpen = True           
MSComm1.InputMode = comInputModeText
MSComm1.Handshaking = comRTSXOnXOff
'        MSComm1.SThreshold
MSComm1.RThreshold = 1
MSComm1.InBufferCount = 0
MSComm1.OutBufferCount = 0
' MSComm1.RThreshold = 1
MSComm1.InputLen = 16
    End If
    MSComm1.OutBufferCount = 0        
    MSComm1.InBufferCount = 0          End Sub
Private Sub MSComm1_OnComm()If MSComm1.InBufferCount > 16 Then
Text1(7).Text = Round(Val((Mid(MSComm1.Input, 8, 7))) + 0.00001, 2)        MSComm1.OutBufferCount = 0          
        MSComm1.InBufferCount = 0             
End IfEnd Sub
现在的问题是一般我的电子秤,用几分钟,电子秤里可以显示数据,要是软件里读取不到,为零。退出窗口,有时候马上进去就可以,有时候要等上几分钟才能恢复读取数据。不知道是我的程序设计的不对还是?我个人的感觉好像是数据读取到一定的量的时候就放不下了,所以读不出来,可我明明设计      MSComm1.OutBufferCount = 0            清除数据。可还是不对,真想不出来错在那里了,帮忙看看吧,谢谢