| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 574 人关注过本帖
标题:请大家都来分析分析这个程序
取消只看楼主 加入收藏
tian112233
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-11-15
收藏
 问题点数:0 回复次数:0 
请大家都来分析分析这个程序

大家都来分析分析这个程序,帮个忙,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

搜索更多相关主题的帖子: 分析 
2006-11-16 08:27
快速回复:请大家都来分析分析这个程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027402 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved