Chapter 9
113
Measurement Applications (Sample Programs)
Executing Multi Correction
9.
M
easu
rem
ent
Applica
tio
ns
(S
amp
le
Prog
ra
ms)
Example 9-4
Executing Multi Correction
Sub Example4()
'===================================
' Configuration
'===================================
Dim defrm As Long 'Session to Default Resource Manager
Dim Agte4981a As Long 'Session to instrument
Const TimeOutTime = 30000
Dim Nop As Integer, i As Integer
Dim Corr_Result As Boolean
Dim Freq As String
On Error GoTo ErrorHandler
'===================================
' Open Instrument
'===================================
ErrorCheck viOpenDefaultRM(defrm)
Call SelectMode(defrm, Agte4981a)
ErrorCheck viSetAttribute(Agte4981a, VI_ATTR_TMO_VALUE,
TimeOutTime)
'===================================
' Setup Start
'===================================
ErrorCheck viVPrintf(Agte4981a, "SYST:PRES;*CLS" + vbLf, 0) '
Preset the E4981A
ErrorCheck viVPrintf(Agte4981a, ":CORR:MULT ON" + vbLf, 0) '
Enable Multi Correction
ErrorCheck viVPrintf(Agte4981a, ":CORR:MULT:CKIT:STAN3 ON" +
vbLf, 0) ' Enable Multi Correction channel-by-channel value
ErrorCheck viVPrintf(Agte4981a, ":DISP:PAGE CSET" + vbLf, 0) '
Display the Correction Page
Freq = InputBox("Enter the frequency (120/1E3/1E6) you want to
measure")