Dim s
Dim aipv As Integer
Dim aisv As Integer
Dim aimv As Integer
Dim rwdata As Integer
Dim crc As Integer
Dim x(0 To 7) As Byte
Private Sub Command1_Click()

    
    Label1.Caption = ""
    
    x(0) = &H81
    x(1) = &H81
    x(2) = &H43
    x(3) = &H1
    x(4) = &H1
    x(5) = &H0
    x(6) = &H45
    x(7) = &H1
    MSComm1.Output = x
    
    Timer1.Enabled = True
    
    
   
End Sub

Private Sub Command2_Click()
    MSComm1.PortOpen = True

End Sub

Private Sub Command3_Click()
    MSComm1.PortOpen = False

End Sub


Private Sub MSComm2_OnComm()

End Sub



Private Sub Timer1_Timer()
    Timer1.Enabled = False

    s = MSComm1.Input
    Open "datafile.bin" For Binary As #1
    Put #1, 1, s
    Get #1, 13, aipv
    Get #1, 15, aisv
    Get #1, 17, aimv
    Get #1, 19, rwdata
    Get #1, 21, crc
    
   
    Label2.Caption = aipv
    Label3.Caption = aisv
    Label4.Caption = aimv
    Label5.Caption = rwdata
    Label6.Caption = crc
    Close #1
    
    
 

End Sub


Ϊ 
InputMode1 - comInputModeBinary 
RThreshold0 
Settings"9600,n,8,2"
