您现在所在的是:

电脑编程

回帖:1个,阅读:1517 [上一页] [1] [下一页]
915
aigwunlai
文章数:8
年度积分:50
历史总积分:915
注册时间:2006/4/14
发站内信
发表于:2006/5/28 17:03:00
#0楼
Private Sub Command1_Click()
Text1.Text = "U      I      t      N " + vbCrLf + "220V  71A   15℃   0r/s" + vbCrLf + "220V  71A   23℃   60r/s" + vbCrLf + "220V  71A   31℃  130r/s" + vbCrLf + "220V  71A   37℃  210r/s" + vbCrLf + "220V  71A   45℃  260r/s" + vbCrLf + "220V  71A   58℃   300r/s" + vbCrLf + "220V  71A   65℃  300r/s"
End Sub

Private Sub Command2_Click()
Shape1.FillColor = &HFF&
Dim U
U = 380
Text1.Text = Text1.Text + vbCrLf + "380V  71A   60℃   0r/s"
Timer1.Enabled = True
Beep
End Sub

Private Sub Command3_Click()
Shape1.FillColor = &HFF&
Text1.Text = Text1.Text + vbCrLf + "220V  100A   70℃   0r/s"
I = 100
Timer1.Enabled = True
Beep
End Sub

Private Sub Command4_Click()
Shape1.FillColor = &HFF&
Text1.Text = Text1.Text + vbCrLf + "220V  71A   80℃   0r/s"
t = 80
Timer1.Enabled = True
Beep
End Sub

Private Sub Command5_Click()
Shape1.FillColor = &HFF&
Text1.Text = Text1.Text + vbCrLf + "220V  71A   60℃  300r/s"
Timer1.Enabled = True
Beep
End Sub

Private Sub Command6_Click()
Shape1.FillColor = &HFF00&
Text1.Text = Text1.Text + vbCrLf + "220V  100A   70℃   300r/s"
End Sub

Private Sub Command7_Click()
Text1.Text = Text1.Text + vbCrLf + "0V     0A     50℃   230r/s" + vbCrLf + "0V     0A     45℃   160r/s" + vbCrLf + "0V     0A     38℃   80r/s" + vbCrLf + "0V     0A     30℃     0r/s" + vbCrLf + "0V     0A     15℃     0r/s"
Shape1.FillColor = &HFF00&
End Sub

Public Sub Form_Load()
Dim U As Integer
Dim I As Integer
Dim t As Integer
U = 220
I = 71
t = 60
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
End Sub

Private Sub MMControl1_Done(NotifyCode As Integer)
If Shape1.FillColor = &HFF& Then
MMControl1.Command = "Open"
MMControl1.Command = "Play"
End If

End Sub

Private Sub Timer1_Timer()
If Shape1.FillColor = &HFF& And U > 220 * 1.5 Then
MsgBox "电压过高"
Exit Sub
Else
If I > 85 Then
MsgBox "短路故障"
Exit Sub
Else
  If t > 80 Then
   MsgBox "温度过高,变压器故障"
  Else
   MsgBox "警报灯故障"
   Exit Sub
  End If
End If
End If
End Sub
本来想实现循环查错的,结果只能出现警报灯错误,谁能帮忙??我知道循环放置位置错误,实在因为太菜了,不好意思
匿名用户
文章数:N/A
年度积分:0
历史总积分:0
注册时间:2007/2/25
发站内信
发表于:2007/2/25 23:55:00
#1楼
该用户被锁定,回复内容不予显示!

关于我们 | 联系我们 | 广告服务 | 本站动态 | 友情链接 | 法律声明 | 非法和不良信息举报

工控网客服热线:0755-86369299
版权所有 工控网 Copyright©2024 Gkong.com, All Rights Reserved

46.8003