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

📄 1.frm

📁 参数整定
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form CSSD 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "参数设定"
   ClientHeight    =   3810
   ClientLeft      =   2040
   ClientTop       =   3435
   ClientWidth     =   6795
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "1.frx":0000
   ScaleHeight     =   3810
   ScaleWidth      =   6795
   Begin VB.CommandButton CSSURE 
      Caption         =   "确定"
      Height          =   375
      Left            =   720
      TabIndex        =   20
      Top             =   3120
      Width           =   1095
   End
   Begin VB.CommandButton PLGO 
      Caption         =   "下一步"
      Height          =   375
      Left            =   2880
      TabIndex        =   19
      Top             =   3120
      Width           =   1095
   End
   Begin VB.Frame Frame4 
      Caption         =   "增益放大"
      Height          =   2295
      Left            =   5160
      TabIndex        =   14
      Top             =   120
      Width           =   1215
      Begin VB.OptionButton Option4 
         Caption         =   "1000"
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   18
         Top             =   1800
         Width           =   855
      End
      Begin VB.OptionButton Option4 
         Caption         =   "100"
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   17
         Top             =   1320
         Width           =   855
      End
      Begin VB.OptionButton Option4 
         Caption         =   "50"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   16
         Top             =   840
         Width           =   855
      End
      Begin VB.OptionButton Option4 
         Caption         =   "10"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   15
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "预置点"
      Height          =   2295
      Left            =   3600
      TabIndex        =   5
      Top             =   120
      Width           =   1215
      Begin VB.OptionButton Option3 
         Caption         =   "16K"
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   13
         Top             =   1800
         Width           =   735
      End
      Begin VB.OptionButton Option3 
         Caption         =   "8K"
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   12
         Top             =   1320
         Width           =   735
      End
      Begin VB.OptionButton Option3 
         Caption         =   "4K"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   11
         Top             =   840
         Width           =   735
      End
      Begin VB.OptionButton Option3 
         Caption         =   "2K"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   10
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "采样频率"
      Height          =   2295
      Left            =   2040
      TabIndex        =   3
      Top             =   120
      Width           =   1215
      Begin VB.OptionButton Option2 
         Caption         =   "250K"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   9
         Top             =   1800
         Width           =   855
      End
      Begin VB.OptionButton Option2 
         Caption         =   "500K"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   8
         Top             =   1320
         Width           =   975
      End
      Begin VB.OptionButton Option2 
         Caption         =   "1M"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   7
         Top             =   840
         Width           =   735
      End
      Begin VB.OptionButton Option2 
         Caption         =   "2M"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   4
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "供电方式"
      Height          =   2295
      Left            =   480
      TabIndex        =   1
      Top             =   120
      Width           =   1215
      Begin VB.OptionButton Option1 
         Caption         =   "5V"
         Height          =   375
         Index           =   1
         Left            =   120
         TabIndex        =   6
         Top             =   1440
         Width           =   735
      End
      Begin VB.OptionButton Option1 
         Caption         =   "10V"
         Height          =   375
         Index           =   0
         Left            =   120
         TabIndex        =   2
         Top             =   600
         Width           =   735
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4920
      TabIndex        =   0
      Top             =   3120
      Width           =   975
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   0
      Top             =   0
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      CommPort        =   2
      DTREnable       =   -1  'True
      RThreshold      =   1
      InputMode       =   1
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   375
      Left            =   2280
      TabIndex        =   21
      Top             =   2640
      Width           =   3015
   End
End
Attribute VB_Name = "CSSD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
  

Private Sub Command2_Click()
End
End Sub



Private Sub CSSURE_Click()
Dim inData() As Byte
Dim dstart%
Dim outData1(1 To 1) As Byte
Dim outData2(1 To 1) As Byte
Dim outData3(1 To 1) As Byte
Dim outData4(1 To 1) As Byte
Label1.Caption = "正在测试鉴别码..."
outData1(1) = 64
   TX.MSComm1.Output = outData1
Do
  DoEvents
  Loop Until TX.MSComm1.InBufferCount >= 1
  inData = TX.MSComm1.Input
  dstart = LBound(inData)
  If inData(dstart) = 65 Then
  Label1.Caption = "正在设置参数,请稍候..."
  Else
  Label1.Caption = "鉴别码错误,不能设置"
  End If


1:
outData1(1) = 132
outData2(1) = 133
If Option1(0).Value = True Then
   TX.MSComm1.Output = outData1
    ElseIf Option1(1).Value = True Then
     TX.MSComm1.Output = outData2
End If
Do
  DoEvents
  Loop Until TX.MSComm1.InBufferCount >= 1
  inData = TX.MSComm1.Input
  dstart = LBound(inData)
  If inData(dstart) = 66 Then
  GoTo 2:
  Else
      Label1.Caption = "设置未完成!请重试"
  End If
2:
outData1(1) = 134
outData2(1) = 135
outData3(1) = 136
outData4(1) = 137
If Option2(0).Value = True Then
   TX.MSComm1.Output = outData1
    ElseIf Option2(1).Value = True Then
     TX.MSComm1.Output = outData2
      ElseIf Option2(2).Value = True Then
       TX.MSComm1.Output = outData3
        ElseIf Option2(3).Value = True Then
         TX.MSComm1.Output = outData4
End If
Do
  DoEvents
  Loop Until TX.MSComm1.InBufferCount >= 1
  inData = TX.MSComm1.Input
  dstart = LBound(inData)
  If inData(dstart) = 67 Then
  GoTo 3:
  Else
      Label1.Caption = "设置未完成!请重试"
  End If
3:
outData1(1) = 138
outData2(1) = 139
outData3(1) = 140
outData4(1) = 141
If Option3(0).Value = True Then
   TX.MSComm1.Output = outData1
    ElseIf Option3(1).Value = True Then
     TX.MSComm1.Output = outData2
      ElseIf Option3(2).Value = True Then
       TX.MSComm1.Output = outData3
        ElseIf Option3(3).Value = True Then
         TX.MSComm1.Output = outData4
End If
Do
  DoEvents
  Loop Until TX.MSComm1.InBufferCount >= 1
  inData = TX.MSComm1.Input
  dstart = LBound(inData)
  If inData(dstart) = 68 Then
  GoTo 4:
  Else
      Label1.Caption = "设置未完成!请重试"
  End If
4:
outData1(1) = 142
outData2(1) = 143
outData3(1) = 144
outData4(1) = 145
If Option4(0).Value = True Then
   TX.MSComm1.Output = outData1
    ElseIf Option4(1).Value = True Then
     TX.MSComm1.Output = outData2
      ElseIf Option4(2).Value = True Then
       TX.MSComm1.Output = outData3
        ElseIf Option4(3).Value = True Then
         TX.MSComm1.Output = outData4
End If
Do
  DoEvents
  Loop Until TX.MSComm1.InBufferCount >= 1
  inData = TX.MSComm1.Input
  dstart = LBound(inData)
  If inData(dstart) = 69 Then
  Label1.Caption = "设置已完成!"
  PLGO.Enabled = True
  CSSURE.Enabled = False
  Else
      Label1.Caption = "设置未完成!请重试"
  End If
End Sub

Private Sub Form_Load()
TX.MSComm1.PortOpen = True
CSSURE.Enabled = True
PLGO.Enabled = False
Option1(0).Value = True
Option2(0).Value = True
Option3(0).Value = True
Option4(0).Value = True
Label1.Caption = "请选择参数,然后按确定!"
End Sub

Private Sub PLGO_Click()
TX.MSComm1.PortOpen = False
ZJ.Visible = True
Unload CSSD
End Sub

⌨️ 快捷键说明

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