任务要求就是接收160个字节,有些数据是大于127的
 程序能够正确接到1个小于127的字,但是假如单片机连续给PC
 发2个以上PC就溢处!接收的是负数
只要程序如下:
Private Sub Form_Load()
f = 0
MSComm1.CommPort = 1
MSComm1.InputMode = comInputModeBinary
MSComm1.InputLen = 0
MSComm1.RThreshold = 1
MSComm1.Settings = "9600,N,8,1"
'MSComm1.SThreshold = 1
MSComm1.PortOpen = True
MSComm1.DTREnable = Falsecount1 = 0End SubPrivate Sub MSComm1_OnComm()
Dim Buffer As Variant
    Dim ist As String
    Dim temp(1) As Byte
    Dim page As Integer
    Dim a As Byte
    Dim p As Integer
    temp(0) = 127
    f = f + 1
       ' MSComm1.InputMode = comInputModeText
    Select Case MSComm1.CommEvent
             Case comEvReceive
             Buffer = MSComm1.Input
             ist = Buffer
             p = Asc(ist)
             a = p
             aa(f) = a
            Text1.Text = Text1.Text + Trim(a)
    End Select
   End Sub