Agilent Technologies E3633A, E3634A manual Calibration Procedures

Models: E3634A E3633A

1 136
Download 136 pages 23.33 Kb
Page 80
Image 80
Manual background

Chapter 3 Calibration Procedures

An Example program of Excel 97 for Calibration

Error = viWrite(device, ByVal commandString, Len(commandString), actual)

If InStr(commandString, "?") Then

 

 

Error = viRead(device, ByVal ReadBuffer, 512, actual)

 

ReturnString = ReadBuffer

 

 

crlfpos = InStr(ReturnString, Chr$(0))

 

 

If crlfpos Then

 

 

ReturnString = Left(ReturnString, crlfpos - 2)

 

End If

 

 

SendSCPI = ReturnString

 

End

If

 

End Function

 

Private

Function delay(delay_time As Single)

'This routine is used to create delays

Dim

Finish As Single

 

Finish = Timer + delay_time

 

Do

 

 

Loop Until Finish <= Timer

 

End Function

 

Private

Function CheckSecurity() As Boolean

 

Dim

Message As String

 

Dim

SecurityCode As String

 

Message = SendSCPI(power, "Cal:Str?")

Range("B5").Select

ActiveCell.Value = Message

Message = SendSCPI(power, "Cal:Count?")

Range("B6").Select

ActiveCell.Value = Message

Range("B4").Select

SecurityCode = "HP003633"

SendSCPI power, "Cal:Sec:Stat Off," & SecurityCode

Message = SendSCPI(power, "Cal:Sec:Stat?")

If InStr(Message, "1") Then

ActiveCell.Value = "Unable to Unsecure the Power Supply"

CheckSecurity = False

Else

Message = SendSCPI(power, "Syst:Err?")

If InStr(Message, "0") Then

CheckSecurity = True

Else

ActiveCell.Value = Message

CheckSecurity = False

End If

End If

End Function

Continued on next page

79

3

Page 80
Image 80
Agilent Technologies E3633A, E3634A manual Calibration Procedures, An Example program of Excel 97 for Calibration