E5071C
1172
Calibration
• Overview
• Sample Program in Excel VBA
• Sample Program in HT Basic
Other topics about Sample Programs
Overview
The sample program performs calibration with the specified calibration
type.
See Calibration for this programming.
Sample Program in Excel VBA
Sub Cal_Click()
Dim defrm As Long 'Session to Default Resource Manager
Dim vi As Long 'Session to instrument
Dim Ch As String
Dim CalKit As Integer
Dim Port(4) As String
Const TimeOutTime = 40000 'timeout time.
Const Cal85032F = 4 'cal kit number.
Ch = Cells(5, 5) 'Select channel
Port(1) = Cells(3, 6) 'Sets the select port 1.
Port(2) = Cells(3, 7) 'Sets the select port 2.
Port(3) = Cells(3, 8) 'Sets the select port 3.
Port(4) = Cells(3, 9) 'Sets the select port 4.
CalKit = Cal85032F 'Sets cal kit (85032F)
Call viOpenDefaultRM(defrm) 'Initializes the VISA system.
Call viOpen(defrm, "GPIB0::17::INSTR", 0, 0, vi) 'Opens the session to the specified instrument.
Call viSetAttribute(vi, VI_ATTR_TMO_VALUE, TimeOutTime) 'The state of an attribute for the
specified session.
Call viVPrintf(vi, "*RST" & vbLf, 0) 'Presets the setting state of the ENA.
Call viVPrintf(vi, "*CLS" & vbLf, 0) 'Clears the all status register.
Call viVPrintf(vi, ":SENS" & Ch & ":CORR:COLL:CKIT " & CalKit & vbLf, 0) 'Select the calibration kit