📄 frmpara.frm
字号:
TabIndex = 25
Top = 3360
Width = 1695
End
Begin VB.Label Label1
Caption = "输 送 SV 速 率:"
Height = 255
Index = 8
Left = 240
TabIndex = 23
Top = 3000
Width = 1695
End
Begin VB.Label Label1
Caption = "宽 度 PV 速 率:"
Height = 255
Index = 7
Left = 240
TabIndex = 22
Top = 2640
Width = 1695
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "宽 度 SV 速 率:"
Height = 255
Index = 6
Left = 240
TabIndex = 21
Top = 2280
Width = 1695
End
Begin VB.Label Label2
Caption = "秒"
Height = 255
Index = 5
Left = 3480
TabIndex = 20
Top = 1560
Width = 495
End
Begin VB.Label Label1
Caption = "加 油 时 间:"
Height = 255
Index = 5
Left = 240
TabIndex = 19
Top = 1560
Width = 1695
End
Begin VB.Label Label2
Caption = "小时"
Height = 255
Index = 4
Left = 3480
TabIndex = 18
Top = 1200
Width = 495
End
Begin VB.Label Label1
Caption = "加 油 周 期:"
Height = 255
Index = 4
Left = 240
TabIndex = 17
Top = 1200
Width = 1695
End
Begin VB.Label Label1
Caption = "PCB 长 度:"
Height = 255
Index = 3
Left = 240
TabIndex = 16
Top = 1920
Width = 1695
End
Begin VB.Label Label2
Caption = "℃"
Height = 255
Index = 2
Left = 3480
TabIndex = 15
Top = 840
Width = 855
End
Begin VB.Label Label1
Caption = "最 高 温 度:"
Height = 255
Index = 2
Left = 240
TabIndex = 14
Top = 840
Width = 1695
End
Begin VB.Label Label1
Caption = "运 输 长 度:"
Height = 255
Index = 1
Left = 240
TabIndex = 13
Top = 480
Width = 1695
End
Begin VB.Label Label2
Caption = "cm/min"
Height = 255
Index = 0
Left = 3480
TabIndex = 12
Top = 360
Visible = 0 'False
Width = 855
End
Begin VB.Label Label1
Caption = "运输速度最大值:"
Height = 255
Index = 0
Left = 2520
TabIndex = 11
Top = 3360
Visible = 0 'False
Width = 1695
End
End
Begin VB.CommandButton CancelButton
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 9
Top = 4440
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "确定"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 8
Top = 4440
Width = 1215
End
End
Attribute VB_Name = "frmPara"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim IsNotFirst As Boolean
Private Sub CancelButton_Click()
Me.Hide
frmMain.Enabled = True
End Sub
Private Sub Form_Activate()
SetDlgBackColor Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call CancelButton_Click
Cancel = 1
End Sub
Private Sub Form_Load()
txtOption(9).Text = SafeTemp
bTimeEnd = True
OKButton.Enabled = False
End Sub
Private Sub OKButton_Click()
If bTimeEnd Then
Exit Sub
End If
frmMain.sbStatusBar.Panels(1).Text = ""
bTimeEnd = True
OKButton.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim ss As String
Dim j As Long, i As Long
On Error Resume Next
Timer1.Enabled = False
While (Not Ack)
TimeDelay 200
Wend
For i = 0 To 1
ss = frmMain.PLCCommand(1, 3, DeviceAbsAdd("D256"), txtOption.Count - 1, 0, "")
If ss <> "" Then
ss = Mid(ss, 8, (txtOption.Count - 1) * 4)
For j = 0 To txtOption.UBound - 1
txtOption(j).Text = Format(Hex2Dec(Mid(ss, 4 * j + 1, 4)) / 10#, "0.0")
Next
If Val(txtOption(1).Text) > 0 Then
sMaxTemp = Val(txtOption(1).Text)
End If
Exit For
End If
TimeDelay 300
Next
bTimeEnd = False
OKButton.Enabled = True
IsNotFirst = True
Ack = False
End Sub
Private Sub Timer2_Timer()
Dim i As Long, j As Long
Dim ss As String
On Error GoTo Errhandle
Timer2.Enabled = False
If Not Ack Then
Timer2.Enabled = True
Exit Sub
End If
frmInfo.Show , Me
frmInfo.ProgressBar1.Value = 0
For j = 0 To txtOption.UBound - 1
If txtOption(j).Tag = "1" Then
For i = 0 To 1
ss = frmMain.PLCCommand(1, 6, DeviceAbsAdd("D" & 256 + j), CLng(Val(txtOption(j).Text) * 10), 0, "")
If ss = "" Then
TimeDelay 300
Else
txtOption(j).Tag = 0
WritePrivateProfileString "Para", CStr(j), txtOption(j).Text, iniFile
If Val(txtOption(1).Text) > 0 Then
sMaxTemp = Val(txtOption(1).Text)
End If
Exit For
End If
Next
If ss = "" Then
frmMain.sbStatusBar.Panels(1).Text = Time & " D" & 256 + j & "下载失败!"
Call frmMain.AddErrorLog(frmMain.sbStatusBar.Panels(1).Text)
End If
End If
frmInfo.ProgressBar1.Value = (j + 1) * 1000 / txtOption.Count
Next
SafeTemp = Val(txtOption(txtOption.UBound).Text)
WritePrivateProfileString "Para", CStr(txtOption.UBound), txtOption(txtOption.UBound).Text, iniFile
GoTo Out
Errhandle:
frmMain.sbStatusBar.Panels(1).Text = Time & "-机器参数 错误:" & Err.description
Call frmMain.AddErrorLog(frmMain.sbStatusBar.Panels(1).Text)
Err.Clear
Out:
frmInfo.Hide
bTimeEnd = False
OKButton.Enabled = True
Ack = False
End Sub
Private Sub txtOption_Change(Index As Integer)
Dim i As Long
If IsNotFirst Then
txtOption(Index).Tag = "1"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -