📄 formt497.frm
字号:
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 900.284
EndProperty
BeginProperty Column01
ColumnWidth = 705.26
EndProperty
BeginProperty Column02
ColumnWidth = 705.26
EndProperty
BeginProperty Column03
ColumnWidth = 705.26
EndProperty
BeginProperty Column04
ColumnWidth = 705.26
EndProperty
BeginProperty Column05
ColumnWidth = 705.26
EndProperty
BeginProperty Column06
ColumnWidth = 705.26
EndProperty
BeginProperty Column07
ColumnWidth = 705.26
EndProperty
BeginProperty Column08
ColumnWidth = 705.26
EndProperty
BeginProperty Column09
ColumnWidth = 705.26
EndProperty
BeginProperty Column10
ColumnWidth = 705.26
EndProperty
BeginProperty Column11
ColumnWidth = 705.26
EndProperty
BeginProperty Column12
ColumnWidth = 705.26
EndProperty
EndProperty
End
Begin VB.CommandButton CommandT497
Caption = "关闭窗口"
Height = 855
Index = 5
Left = 10320
Picture = "FormT497.frx":045A
Style = 1 'Graphical
TabIndex = 21
Top = 6360
Width = 1215
End
Begin VB.CommandButton CommandT497
Caption = "数据转存"
Height = 855
Index = 4
Left = 9120
Picture = "FormT497.frx":089C
Style = 1 'Graphical
TabIndex = 20
Top = 6360
Width = 1215
End
Begin VB.CommandButton CommandT497
Caption = "停止测试"
Height = 855
Index = 3
Left = 10320
Picture = "FormT497.frx":0CDE
Style = 1 'Graphical
TabIndex = 19
Top = 5520
Width = 1215
End
Begin VB.CommandButton CommandT497
Caption = "开始测试"
Height = 855
Index = 2
Left = 9120
Picture = "FormT497.frx":1120
Style = 1 'Graphical
TabIndex = 18
Top = 5520
Width = 1215
End
Begin VB.Frame FrameT497
Caption = " 测试状态 "
Height = 1815
Index = 1
Left = 6480
TabIndex = 16
Top = 5400
Width = 2175
Begin VB.Label LabelT497
Caption = "就绪"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 7
Left = 240
TabIndex = 38
Top = 240
Width = 1815
End
Begin VB.Label LabelT497
Caption = "0:00:00"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 0
Left = 240
TabIndex = 17
Top = 1080
Width = 1815
End
End
Begin VB.Frame FrameT497
Caption = " 测试设置 "
Height = 1815
Index = 0
Left = 240
TabIndex = 0
Top = 5400
Width = 5895
Begin VB.OptionButton OptionT497
Caption = "档位2"
Height = 255
Index = 2
Left = 2520
TabIndex = 15
Top = 480
Width = 1095
End
Begin VB.CheckBox CheckT497
Caption = "位置9"
Height = 255
Index = 9
Left = 3600
TabIndex = 14
Top = 1320
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置8"
Height = 255
Index = 8
Left = 2760
TabIndex = 13
Top = 1320
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置7"
Height = 255
Index = 7
Left = 1920
TabIndex = 12
Top = 1320
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置6"
Height = 255
Index = 6
Left = 1080
TabIndex = 11
Top = 1320
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置2"
Height = 255
Index = 2
Left = 1920
TabIndex = 10
Top = 960
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置1"
Height = 255
Index = 1
Left = 1080
TabIndex = 9
Top = 960
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置5"
Height = 255
Index = 5
Left = 240
TabIndex = 8
Top = 1320
Width = 800
End
Begin VB.CommandButton CommandT497
Caption = "清空设置"
Height = 495
Index = 1
Left = 4560
TabIndex = 7
Top = 360
Width = 1095
End
Begin VB.CommandButton CommandT497
Caption = "默认设置"
Height = 495
Index = 0
Left = 4560
TabIndex = 6
Top = 1080
Width = 1095
End
Begin VB.CheckBox CheckT497
Caption = "位置4"
Height = 255
Index = 4
Left = 3600
TabIndex = 5
Top = 960
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置3"
Height = 255
Index = 3
Left = 2760
TabIndex = 4
Top = 960
Width = 800
End
Begin VB.CheckBox CheckT497
Caption = "位置0"
Height = 255
Index = 0
Left = 240
TabIndex = 3
Top = 960
Width = 800
End
Begin VB.OptionButton OptionT497
Caption = "档位1"
Height = 255
Index = 1
Left = 1440
TabIndex = 2
Top = 480
Width = 1095
End
Begin VB.OptionButton OptionT497
Caption = "档位0"
Height = 255
Index = 0
Left = 240
TabIndex = 1
Top = 480
Width = 1095
End
End
End
Attribute VB_Name = "FormT497"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Tstart(11) As Date 'Tdata 存放起停时间
Dim iRecordNo(10) As Integer 'iRecordNo 存放时间记录记录到第几个了,一共有12个时间记录
Dim iBeepCounter, iLedCounter As Integer
Dim blState(10), blLed, blBegin As Boolean 'TRUE 运行,FALSE 停止
'True 时为1;False 时为0
Dim rsT497 As ADODB.Recordset
Private Sub CommandT497_Click(Index As Integer)
Dim i, j, k, iTemp, iCounter As Integer
Dim B378, B379, B37A, bTemp As Byte
If blBegin = True Then
If Index <> 3 Then
Exit Sub
End If
End If
Select Case Index
'-------------------------------------------------------
Case 0 '默认设置
OptionT497(1).Value = True
For i = 0 To 9
CheckT497(i).Value = 1
Next i
'-------------------------------------------------------
Case 1 '清空设置
OptionT497(0).Value = True
For i = 0 To 9
CheckT497(i).Value = 0
Next i
'-------------------------------------------------------
Case 2 '开始测试
'检查是否选择了通道
iTemp = 0
For i = 0 To 9
iTemp = iTemp + CheckT497(i).Value
Next i
If iTemp = 0 Then
MsgBox " 请选择测试通道 ", vbOKOnly, "497测试"
Exit Sub
End If
'检查检测信息是否输入完全
iTemp = 0
For i = 0 To 4
If TextT497(i).Text = "" Then
iTemp = iTemp + 1
End If
Next i
If iTemp <> 0 Then
MsgBox " 请详细填写测试信息 ", vbOKOnly, "497测试"
Exit Sub
End If
'检测时间是否非法
If IsDate(TextT497(0).Text) = False Then
MsgBox " 生产时间非法,重新输入 ", vbOKOnly, "497测试"
Exit Sub
End If
'开始检测
vbBeep 10
With AdodcT497.Recordset '数据库初始化
iCounter = .RecordCount
If iCounter <> 0 Then
.MoveFirst
For i = 1 To iCounter
.Delete
.MoveNext
Next i
.UpdateBatch
End If
For i = 0 To 9 '记录空表
If CheckT497(i).Value = 1 Then
If IsNumeric(TextT497(3).Text) = False Then
MsgBox " 请输入正确的生产数量! ", vbOKOnly, "497马达间歇测试"
Exit Sub
End If
.AddNew
.Fields("生产时间") = TextT497(0).Text
.Fields("生产线") = TextT497(1).Text
.Fields("生产单号") = TextT497(2).Text
.Fields("生产数量") = TextT497(3).Text
.Fields("测试时间") = Now()
.Fields("测试人员") = TextT497(4).Text
.Fields("机位编号") = i
For j = 0 To 2
If OptionT497(j).Value = True Then
.Fields("档位") = j
Exit For
End If
Next j
.Fields("备注") = TextT497(5).Text
.Update
End If
Next i
End With
For i = 0 To 9
blState(i) = True
Tstart(i) = Now()
iRecordNo(i) = STARTNO - 1
Next i
Tstart(10) = Now() '测试起始时间
LabelT497(7).Caption = "检测中.."
blLed = True
PowerOff
If MsgBox("以上设置是否正确?检测是否开始?", vbOKCancel, "497马达检测") = vbCancel Then
Exit Sub
End If
blBegin = True
PowerOn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -