Chapter 9
151
Measurement Applications (Sample Programs)
Capacitor Measurement Using Test Fixture
9.
M
easu
rem
ent
Applica
tio
ns
(S
amp
le
Prog
ra
ms)
Example 9-15
Capacitor Measurement Using Test Fixture
Sub Example15()
'===================================
' Configuration
'===================================
Dim defrm As Long 'Session to Default Resource Manager
Dim Agte4981a As Long 'Session to instrument
Dim Result As String * 500
Dim Res As Variant
Dim Nop As Integer, i As Integer
Dim Corr_File_Name As String
Dim Freq As String
Const TimeOutTime = 30000
On Error GoTo ErrorHandler
'===================================
' Open Instrument
'===================================
ErrorCheck viOpenDefaultRM(defrm)
Call SelectMode(defrm, Agte4981a)
ErrorCheck viSetAttribute(Agte4981a, VI_ATTR_TMO_VALUE,
TimeOutTime)
'===================================
' Setup Start
'===================================
MsgBox "Connect the Test Fixture and then press OK", vbOKOnly
ErrorCheck viVPrintf(Agte4981a, "SYST:PRES;*CLS" + vbLf, 0) ' Preset
E4981A
Freq = InputBox("Enter the frequency (120/1E3/1E6) you want to
measure")