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

📄 hp34401_ivicom.frm

📁 远程控制agilent33201函数发生器
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3315
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5430
   LinkTopic       =   "Form1"
   ScaleHeight     =   3315
   ScaleWidth      =   5430
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command2 
      Caption         =   "Pause"
      Height          =   495
      Left            =   2160
      TabIndex        =   9
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   288
      Left            =   1800
      TabIndex        =   7
      Text            =   "3"
      Top             =   1680
      Width           =   1452
   End
   Begin VB.TextBox Text1 
      Height          =   288
      Left            =   1800
      TabIndex        =   4
      Text            =   "5"
      Top             =   1320
      Width           =   1452
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   1
      Left            =   5040
      Top             =   0
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Exit"
      Height          =   492
      Left            =   3720
      TabIndex        =   3
      Top             =   2400
      Width           =   1332
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Monitor"
      Height          =   492
      Left            =   360
      TabIndex        =   0
      Top             =   2400
      Width           =   1332
   End
   Begin VB.Label Label5 
      Caption         =   "PASS"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   3840
      TabIndex        =   8
      Top             =   720
      Width           =   1212
   End
   Begin VB.Label Label4 
      Caption         =   "Bottom Voltage(V)"
      Height          =   372
      Left            =   360
      TabIndex        =   6
      Top             =   1680
      Width           =   1332
   End
   Begin VB.Label Label3 
      Caption         =   "Uplimit Voltage(V)"
      Height          =   372
      Left            =   360
      TabIndex        =   5
      Top             =   1320
      Width           =   1572
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   2280
      TabIndex        =   2
      Top             =   720
      Width           =   1452
   End
   Begin VB.Label Label1 
      Caption         =   "DC Voltage(V)"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   1932
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DMM As Agilent34401
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
If Timer1.Enabled Then
  Command1.Caption = "Stop"
Else
  Command1.Caption = "Monitor"
End If
End Sub
Private Sub Command2_Click()
  Timer1.Enabled = Not Timer1.Enabled '定时器的开关
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Set DMM = New Agilent34401
   
' Assign GP-IB address to 22
DMM.Initialize "GPIB0::12::INSTR", True, True, ""
DMM.Utility.Reset
DMM.Status.Clear

' Set function property into DC voltage
DMM.Function = Agilent34401FunctionDCVolts
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
Dim data As Double
data = DMM.Measurement.Read(5000)
Label2.Caption = data
If data > Val(Text2.Text) And data < Val(Text1.Text) Then
  Label5.Caption = "PASS"
Else
  Label5.Caption = "FAIL"
End If
End Sub

⌨️ 快捷键说明

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