Chapter 3 Calibration Procedures
An Example program of Excel 97 for Calibration
75
3
An Example program of Excel 97 for Calibration
This section contains an Excel Macros (Visual Basic
®
for Applicatio ns)
program for calibration over the GPIB interface. This program makes software
adjustments to the E3633A power supply using a current shunt and a digital
multimeter which is connected to the controller. In this program a 0.001 ohm
current shunt is used. Be sure to change the value of the variable ‘‘shunt’’ to
the value of the current shunt use d and the GPIB addre ss for the power supply
and the digital voltmeter.
'**************************************************************************************
'This program was written on a PC with Excel Macros (Visual Basic
®
for Applications)
'for Windows 95 or Windows NT 4.0. It will make software adjustments to the E3633A
'Power Supply on the GPIB bus using a Agilent 34401A Digital Multimeter and a current
'shunt. In the program a 0.001 ohm current shunt is used to measure current. Be sure to
'change the value of the variable ‘shunt’ to the value of the current shunt used.
'**************************************************************************************
Global id_power As Long
Global id_DMM As Long
Global power As Long
Global DMM As Long
Global Const VI_SUCCESS = &H0&
Global Const VoltageMin = 0
Global Const VoltageMid = 1
Global Const VoltageMax = 2
Global Const CurrentMin = 3
Global Const CurrentMid = 4
Global Const CurrentMax = 5
Sub Calibration_Click()
Dim shunt As Single 'Current shunt value in Ohms
Dim UserAnswer 'User response
Range("B4:B6").ClearContents
If OpenPort = False Then
ClosePort
Exit Sub
End If
InitializeDevice
EnableOVPandOCP False
If CheckSecurity = False Then
ClosePort
Exit Sub
End If
Continued on next page