大家都来分析分析这个程序,帮个忙,sendbufx(0) = 90到MSComm1.Output = sendbufx() 之间的;语句是什么意思
Private Sub Timer2_Timer()
Dim sendbufx(6) As Byte
Dim receivebuf As String
Dim a1(20) As String
Dim receivefx(33) As String
Dim dl_A As String
Dim dl_B As String
Dim dy_U As String
Dim gz As String
Dim shiyan As String
Dim adr As String
Dim i As Integer
Dim j As Integer
i = 0
j = 1
sendbufx(0) = 90
If abc < 16 Then
sendbufx(1) = 48
sendbufx(2) = 48 + abc
End If
If abc > 15 Then
sendbufx(1) = 49
sendbufx(2) = 32 + abc
End If
sendbufx(3) = 53
sendbufx(4) = 53
sendbufx(5) = 48
sendbufx(6) = 58
'
MSComm1.OutBufferCount = 0
MSComm1.Output = sendbufx()
receivebuf = MSComm1.Input
Do While i < 34
receivefx(i) = Hex(Asc(Mid(receivebuf, j, 1) & Chr(32)))
i = i + 1
j = j + 1
Loop
MSComm1.InBufferCount = 0
dl_A = Mid(receivefx(10), 2, 1) & Mid(receivefx(11), 2, 1) & Mid(receivefx(12), 2, 1) _
& Mid(receivefx(13), 2, 1) & Mid(receivefx(14), 2, 1) & Mid(receivefx(15), 2, 1)
dy_U = Mid(receivefx(28), 2, 1) & Mid(receivefx(29), 2, 1) & Mid(receivefx(30), 2, 1) _
& Mid(receivefx(31), 2, 1)
dl_A = CLng(dl_A) / 100
dl_B = Mid(receivefx(8), 2, 1) & Mid(receivefx(9), 2, 1)
dl_B = CInt(dl_B)
dy_U = CInt(dy_U)
cv = abc - 1
If cv = 0 Then
abc = abc + 1
Exit Sub
End If
Text1(cv * 2 - 1).Text = dl_A
Select Case dl_B
Case 1
Text1(cv * 2 - 2).Text = "过流"
Case 2
Text1(cv * 2 - 2).Text = "堵转"
Case 4
Text1(cv * 2 - 2).Text = "电流不平"
Case 8
Text1(cv * 2 - 2).Text = "断相"
Case 10
Text1(cv * 2 - 2).Text = "欠压"
Case 20
Text1(cv * 2 - 2).Text = "过压"
Case 40
Text1(cv * 2 - 2).Text = "短路"
Case 80
Text1(cv * 2 - 2).Text = "漏电"
Case Else
If dy_U = 0 Then
Text1(cv * 2 - 2).Text = "失电"
Else
Text1(cv * 2 - 2).Text = "正常"
End If
End Select
abc = abc + 1
If abc > 21 Then abc = 1
End Sub