⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 参数设置3507.frm

📁 一个网带烧结炉的程序,串口通讯,做工业自动化的可以参考
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFC0&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "设置网带速度"
         BeginProperty Font 
            Name            =   "华文新魏"
            Size            =   18
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   495
         Index           =   0
         Left            =   360
         TabIndex        =   27
         Top             =   3720
         Width           =   3375
      End
      Begin VB.Label Label21 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFC0&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "七温区"
         BeginProperty Font 
            Name            =   "华文新魏"
            Size            =   18
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   405
         Left            =   360
         TabIndex        =   26
         Top             =   3330
         Width           =   1695
      End
      Begin VB.Label Label22 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFC0&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "五温区"
         BeginProperty Font 
            Name            =   "华文新魏"
            Size            =   18
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   405
         Left            =   360
         TabIndex        =   25
         Top             =   2550
         Width           =   1695
      End
      Begin VB.Label Label17 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFC0&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "自整定"
         BeginProperty Font 
            Name            =   "华文新魏"
            Size            =   18
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   495
         Left            =   5370
         TabIndex        =   24
         Top             =   390
         Width           =   1695
      End
      Begin VB.Label Label25 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "mm\min"
         BeginProperty Font 
            Name            =   "华文新魏"
            Size            =   18
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   345
         Index           =   1
         Left            =   5370
         TabIndex        =   23
         Top             =   3870
         Width           =   1575
      End
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   240
      Top             =   90
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Menu 选择工艺参数 
      Caption         =   "选择工艺参数"
   End
   Begin VB.Menu 保存工艺参数 
      Caption         =   "保存工艺参数"
   End
   Begin VB.Menu 退出 
      Caption         =   "退出"
   End
End
Attribute VB_Name = "参数设置3507"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click(Index As Integer)

If Check1(Index) = 1 Then

  writeat_sr90_3507 Index + 1, 1
Else

  writeat_sr90_3507 Index + 1, 0
End If
End Sub

Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 7

       writecom_sr90_3507 i, 1
Next i

End Sub

Private Sub Command2_Click()
Dim i As Integer
For i = 1 To 7

       writecom_sr90_3507 i, 0
Next i
End Sub

Private Sub Form_Load()
Open App.Path + "\工艺参数\" + "初始化3507.con" For Random As #1
    Get #1, , curgy3507
Close #1
Text6.Text = curgy3507.speed
For i = 0 To 6
Text1(i).Text = curgy3507.sv(i)
Text2(i).Text = curgy3507.ev1sp(i)
Next i
End Sub

Private Sub lowctrcmd_Click() '下传控制参数
ProgressBar1.Visible = True

For i = 0 To 6
writesv_sr90_3507 i + 1, Val(Text1(i))
writeev1sp_sr90_3507 i + 1, Val(Text2(i))

form1.Text1(i).Text = 参数设置3507.Text1(i).Text

ProgressBar1.Value = (i + 1) * 14
Next i

bpcomm_3507 "WS05", Val(Text6)
form1.Text2.Text = 参数设置3507.Text6.Text
ProgressBar1.Value = 100
ProgressBar1.Visible = False
End Sub



Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) '键入设置温度
If ((KeyAscii >= 48 And KeyAscii <= 57) Or (KeyAscii = 8)) Then
     Text1(Index).Locked = False
     Else
     Text1(Index).Locked = True
End If
If KeyAscii = 13 Then
   If Text1(Index).Text = "" Then
     Text1(Index).Text = curgy3507.sv(Index)
     Else
     curgy3507.sv(Index) = Text1(Index).Text
     End If
 End If
End Sub
Private Sub Text1_LostFocus(Index As Integer)   '失去焦点,判断是否回车
If Text1(Index).Text = "" Then
Text1(Index).Text = curgy3507.sv(Index)
Else
curgy3507.sv(Index) = Val(Text1(Index).Text)
End If
End Sub
Private Sub Text1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub

Private Sub Text2_KeyPress(Index As Integer, KeyAscii As Integer) '键入报警限
If ((KeyAscii >= 48 And KeyAscii <= 57) Or (KeyAscii = 8)) Then
     Text2(Index).Locked = False
     Else
     Text2(Index).Locked = True
End If
If KeyAscii = 13 Then
   If Text2(Index).Text = "" Then
     Text2(Index).Text = curgy3507.ev1sp(Index)
     Else
     curgy3507.ev1sp(Index) = Text2(Index).Text
     End If
 End If
End Sub
Private Sub Text2_LostFocus(Index As Integer)
If Text2(Index).Text = "" Then
Text2(Index).Text = curgy3507.ev1sp(Index)
Else
curgy3507.ev1sp(Index) = Val(Text2(Index).Text)
End If
End Sub

Private Sub Text2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Text2(Index).SelStart = 0
Text2(Index).SelLength = Len(Text2(Index))
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer) '键入网带速度
If ((KeyAscii >= 48 And KeyAscii <= 57) Or (KeyAscii = 8)) Then
     Text6.Locked = False
     Else
     Text6.Locked = True
End If
If KeyAscii = 13 Then
   If Text6.Text = "" Then
     Text6.Text = curgy3507.speed
     Else
     curgy3507.speed = Text6.Text
     End If
 End If
End Sub

Private Sub Text6_LostFocus()
If Text6.Text = "" Then
Text6.Text = curgy3507.speed
Else
curgy3507.speed = Val(Text6.Text)
End If
End Sub

Private Sub Text6_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text6.SelStart = 0
Text6.SelLength = Len(Text6)
End Sub

Private Sub upctrcmd_Click() '上传控制参数
Dim temp As Integer

ProgressBar1.Visible = True
For i = 0 To 6
temp = readsv_sr90_3507(i + 1)           'sv
If temp <> -1 Then
    Text1(i) = temp
Else
    temp = readsv_sr90_3507(i + 1)
    If temp <> -1 Then Text1(i) = temp
End If
ProgressBar1.Value = (i + 1) * 3.5
Next i


For i = 0 To 6
temp = readev1sp_sr90_3507(i + 1)         'alarm
If temp <> -1 Then
    Text2(i) = temp
Else
    temp = readev1sp_sr90_3507(i + 1)
    If temp <> -1 Then Text2(i) = temp
End If


ProgressBar1.Value = (i + 1) * 3.5 + 40.5
Next i

temp = bpcomm_3507("RM05", 0)
If temp <> 0 Then
    Text6 = temp
Else
    Text6 = bpcomm_3507("RM05", 0)
End If

ProgressBar1.Value = 100
ProgressBar1.Visible = False
End Sub

Private Sub 保存工艺参数_Click()
On Error GoTo nofile
CommonDialog1.DialogTitle = "存储工艺文件"
CommonDialog1.CancelError = True
CommonDialog1.Filter = "工艺文件(*.con)|*.con|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
nofile:
If Err.Number = 32755 Then Exit Sub

For i = 0 To 6
    curgy3507.sv(i) = Val(Text1(i))
    curgy3507.ev1sp(i) = Val(Text2(i))
Next i
    curgy3507.speed = Val(Text6)

If Len(CommonDialog1.filename) = 0 Then
Exit Sub
End If

Open CommonDialog1.filename For Binary As #1
    Put #1, , curgy3507
Close #1

End Sub

Private Sub 退出_Click()
For i = 0 To 6
curgy3507.sv(i) = Val(Text1(i))
curgy3507.ev1sp(i) = Val(Text2(i))
Next
curgy3507.speed = Val(Text6)

Open App.Path + "\工艺参数\" + "初始化3507.con" For Random As #1
   Put #1, , curgy3507
Close #1

Unload Me
End Sub

Private Sub 选择工艺参数_Click()
On Error GoTo nofile
CommonDialog1.DialogTitle = "打开工艺文件"
CommonDialog1.CancelError = True
CommonDialog1.Filter = "工艺文件(*.con)|*.con|所有文件(*.*)|*.*"
CommonDialog1.ShowOpen

If Len(CommonDialog1.filename) = 0 Then
Exit Sub
End If
nofile:
If Err.Number = 32755 Then Exit Sub

Open CommonDialog1.filename For Binary As #1
    Get #1, , curgy3507
Close #1

For i = 0 To 6
    Text1(i) = curgy3507.sv(i)
    Text2(i) = curgy3507.ev1sp(i)
Next i
Text6 = curgy3507.speed
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -