Agilent Technologies E3634A Portable Generator User Manual


 
Chapter 3 Calibration Procedures
An Example program of Excel 97 for Calibration
77
3
ActiveCell.Value = "End Middle Current Calibration"
StartCalibration CurrentMax, False, shunt 'Set output to maximum current cal
ActiveCell.Value = "End Maximum Current Calibration"
OVPandOCPCalibration False
Message = SendSCPI(power, "Syst:Err?")
If InStr(Message, "0") Then
ActiveCell.Value = "Current Calibration Complete"
Else
ActiveCell.Value = Message
ClosePort
Exit Sub
End If
EnableOVPandOCP True
SaveDate
ActiveCell.Value = "Calibration Complete"
Message = SendSCPI(power, "*RST")
ClosePort
End Sub
Private Function OpenPort() As Boolean 'Open communications on GPIB
Dim Power_Address As String
Dim DMM_Address As String
Dim Error As Long
Power_Address = "5" 'Select power supply GPIB address between 0 to 30
DMM_Address = "22" 'Select DMM GPIB address between 0 to 30
Error = viOpenDefaultRM(id_power) 'Open the power supply VISA session
If OpenPort = CheckError(Error, "Open ID Error to Power Supply") Then
Exit Function
End If
Error = viOpenDefaultRM(id_DMM) 'Open the DMM VISA session
If OpenPort = CheckError(Error, "Open ID Error to Digital Multi Meter") Then
Exit Function
End If
Error = viOpen(id_power, "GPIB0::" & Power_Address & "::INSTR", 0, 1000, power)
If OpenPort = CheckError(Error, "Unable Open to Power Supply") Then
Exit Function
End If
Error = viOpen(id_DMM, "GPIB0::" & DMM_Address & "::INSTR", 0, 1000, DMM)
If OpenPort = CheckError(Error, "Unable Open to Digital Multi Meter") Then
Exit Function
End If
OpenPort = True
End Function
Continued on next page