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

📄 adform.frm

📁 ISAbankaqudong henhaoyongdeshigehaoruanjian
💻 FRM
字号:
VERSION 5.00
Begin VB.Form AdForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "A/D 测试界面"
   ClientHeight    =   4560
   ClientLeft      =   1470
   ClientTop       =   1230
   ClientWidth     =   5985
   BeginProperty Font 
      Name            =   "System"
      Size            =   12
      Charset         =   134
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4560
   ScaleWidth      =   5985
   ShowInTaskbar   =   0   'False
   Begin VB.Timer AdTimer 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   4200
      Top             =   2520
   End
   Begin VB.CommandButton Exit 
      Cancel          =   -1  'True
      Caption         =   "返      回"
      Default         =   -1  'True
      Height          =   495
      Left            =   4455
      TabIndex        =   4
      Top             =   3720
      Width           =   1335
   End
   Begin VB.CommandButton ChCom 
      Caption         =   "参数设置"
      Height          =   495
      Left            =   4440
      TabIndex        =   3
      Top             =   3120
      Width           =   1335
   End
   Begin VB.CommandButton AdCom 
      Caption         =   "开始采样"
      Height          =   495
      Left            =   4440
      TabIndex        =   2
      Top             =   2520
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Caption         =   "AD量程选择"
      Height          =   1575
      Left            =   4320
      TabIndex        =   37
      Top             =   240
      Width           =   1575
      Begin VB.OptionButton Ncxz 
         Caption         =   " -10--10V"
         Height          =   375
         Index           =   2
         Left            =   120
         TabIndex        =   39
         Top             =   1080
         Width           =   1215
      End
      Begin VB.OptionButton Ncxz 
         Caption         =   "   -5--  5V"
         Height          =   375
         Index           =   1
         Left            =   120
         TabIndex        =   38
         Top             =   720
         Width           =   1215
      End
      Begin VB.OptionButton Ncxz 
         Caption         =   "    0--10V"
         Height          =   375
         Index           =   0
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Value           =   -1  'True
         Width           =   1215
      End
   End
   Begin VB.Frame AdDispFrame 
      Caption         =   "AD采样数据显示区"
      Height          =   4215
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   4095
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   15
         Left            =   2880
         TabIndex        =   28
         Top             =   3720
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   14
         Left            =   2880
         TabIndex        =   27
         Top             =   3252
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   13
         Left            =   2880
         TabIndex        =   26
         Top             =   2790
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   12
         Left            =   2880
         TabIndex        =   25
         Top             =   2328
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   11
         Left            =   2880
         TabIndex        =   24
         Top             =   1866
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   10
         Left            =   2880
         TabIndex        =   23
         Top             =   1404
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   9
         Left            =   2880
         TabIndex        =   22
         Top             =   942
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   8
         Left            =   2880
         TabIndex        =   13
         Top             =   480
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   7
         Left            =   840
         TabIndex        =   12
         Top             =   3720
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   6
         Left            =   840
         TabIndex        =   11
         Top             =   3252
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   5
         Left            =   840
         TabIndex        =   10
         Top             =   2790
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   4
         Left            =   840
         TabIndex        =   9
         Top             =   2328
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   3
         Left            =   840
         TabIndex        =   8
         Top             =   1866
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   2
         Left            =   840
         TabIndex        =   7
         Top             =   1404
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   1
         Left            =   840
         TabIndex        =   6
         Top             =   942
         Width           =   1095
      End
      Begin VB.TextBox Addata 
         Height          =   375
         Index           =   0
         Left            =   840
         TabIndex        =   5
         Top             =   480
         Width           =   1095
      End
      Begin VB.Label Label16 
         Caption         =   "CH16:"
         Height          =   240
         Left            =   2160
         TabIndex        =   36
         Top             =   3720
         Width           =   585
      End
      Begin VB.Label Label15 
         Caption         =   "CH15:"
         Height          =   240
         Left            =   2160
         TabIndex        =   35
         Top             =   3252
         Width           =   585
      End
      Begin VB.Label Label14 
         Caption         =   "CH14:"
         Height          =   240
         Left            =   2160
         TabIndex        =   34
         Top             =   2790
         Width           =   585
      End
      Begin VB.Label Label13 
         Caption         =   "CH13:"
         Height          =   240
         Left            =   2160
         TabIndex        =   33
         Top             =   2328
         Width           =   585
      End
      Begin VB.Label Label12 
         Caption         =   "CH12:"
         Height          =   240
         Left            =   2160
         TabIndex        =   32
         Top             =   1866
         Width           =   585
      End
      Begin VB.Label Label11 
         Caption         =   "CH11:"
         Height          =   240
         Left            =   2160
         TabIndex        =   31
         Top             =   1404
         Width           =   585
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "CH10:"
         Height          =   240
         Left            =   2160
         TabIndex        =   30
         Top             =   942
         Width           =   585
      End
      Begin VB.Label Label9 
         Caption         =   "CH09:"
         Height          =   240
         Left            =   2160
         TabIndex        =   29
         Top             =   480
         Width           =   585
      End
      Begin VB.Label Label8 
         Caption         =   "CH08:"
         Height          =   240
         Left            =   120
         TabIndex        =   21
         Top             =   3720
         Width           =   585
      End
      Begin VB.Label Label7 
         Caption         =   "CH07:"
         Height          =   240
         Left            =   120
         TabIndex        =   20
         Top             =   3252
         Width           =   585
      End
      Begin VB.Label Label6 
         Caption         =   "CH06:"
         Height          =   240
         Left            =   120
         TabIndex        =   19
         Top             =   2790
         Width           =   585
      End
      Begin VB.Label Label5 
         Caption         =   "CH05:"
         Height          =   240
         Left            =   120
         TabIndex        =   18
         Top             =   2328
         Width           =   585
      End
      Begin VB.Label Label4 
         Caption         =   "CH04:"
         Height          =   240
         Left            =   120
         TabIndex        =   17
         Top             =   1866
         Width           =   585
      End
      Begin VB.Label Label3 
         Caption         =   "CH03:"
         Height          =   240
         Left            =   120
         TabIndex        =   16
         Top             =   1404
         Width           =   585
      End
      Begin VB.Label Label2 
         Caption         =   "CH02:"
         Height          =   240
         Left            =   120
         TabIndex        =   15
         Top             =   942
         Width           =   585
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "CH01:"
         Height          =   240
         Left            =   120
         TabIndex        =   14
         Top             =   480
         Width           =   585
      End
   End
End
Attribute VB_Name = "AdForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub AdCom_Click()
 If AdCom.Caption = "开始采样" Then
   AdTimer.Enabled = True
   Call pcreg
   AdCom.Caption = "停止采样"
Else
   AdTimer.Enabled = False
   AdCom.Caption = "开始采样"
End If
End Sub

Private Sub AdTimer_Timer()
 Dim add(16)
 Dim data1, data2, data3 As Integer
 Dim i As Byte
 
 b = 10# / 4096#
 For i = 0 To 2
  If Ncxz(i) = True Then: n = i
 Next i
 Select Case n
  Case 0
     c = 0
  Case 1
  
     c = 5
  Case 2
     b = 20# / 4096#
     c = 10
 End Select
 
For i = 0 To 15
    add(i) = 0
  Call pcout(&H300, i, delay)
  Call pcout(&H301, 0, delay)
  data1 = pcin(&H302, delay)
  data2 = pcin(&H303, delay)
  data3 = (data2 And (&HFF)) * 16 + (data1 And (&HF0)) / 16
'add(i) = pc7423ad(port, i, delay) * b - c
   add(i) = data3 * b - c
 Next i
 
For i = 0 To 15
   If ch(i) = True Then
     Addata(i) = add(i) / 1
  End If
Next i
End Sub

Private Sub ChCom_Click()
 ChForm.Show vbModal, Me
End Sub

Private Sub Exit_Click()

 Unload AdForm
End Sub

Private Sub Form_Load()
 For i = 0 To 15
  ch(i) = True
  Addata(i) = 0
 Next i
End Sub

⌨️ 快捷键说明

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