Sample Program In Excel Vba - Agilent Technologies E5071C Manual

Hide thumbs Also See for E5071C:
Table of Contents

Advertisement

E5071C
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
Dim vi As Long
Dim Ch As String
Dim CalKit As Integer
Dim Port(4) As String
Const TimeOutTime = 40000 'timeout time.
Const Cal85032F = 4
Ch = Cells(5, 5)
Port(1) = Cells(3, 6)
Port(2) = Cells(3, 7)
Port(3) = Cells(3, 8)
Port(4) = Cells(3, 9)
CalKit = Cal85032F
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
1172
'Session to Default Resource Manager
'Session to instrument
'cal kit number.
'Select channel
'Sets the select port 1.
'Sets the select port 2.
'Sets the select port 3.
'Sets the select port 4.
'Sets cal kit (85032F)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents