本帖最后由 skevil 于 2012-12-12 22:15:14 编辑

解决方案 »

  1.   

    1.
    MSComm1.RThreshold = 42.
        Dim bytInput() As Byte
        Dim tmp As Variant        Case comEvReceive
       
             intInputLen = MSComm1.InBufferCount
            tmp = MSComm1.Input
            bytInput = tmp
                
            For n = LBound(bytInput) To UBound(bytInput)      ' 把接收的数据安十六进制格式放入缓冲中
                If bytInput(n) = &HFF And bytInput(n + 3) = &HFF Then
                    buffer = buffer & Right("0" & Hex(bytInput(n + 1)), 2) & Right("0" & Hex(bytInput(n + 2)), 2) & " "
                    n = n + 3
                End If    
            Next n
            
            Text2.Text = buffer