Technical data
Application Programs 5
Example Program for Excel 97
E364xA User’s and Service Guide 145
Private Function ClosePort()
ErrorStatus = viClose(power_supply)
ErrorStatus = viClose(defaultRM)
End Function
Private Function delay(delay_time As Single)
Dim Finish As Single
Finish = Timer + delay_time
Do
Loop Until Finish <= Timer
End Function
Private Function CheckError(ErrorMessage As String)
If ErrorStatus < VI_SUCCESS Then
Cells(5, 2) = ErrorMessage
ClosePort
End
End If
End Function
End of program
Declaration for Windows 3.1
'************************************************************************************
' This routine requires the VISA.dll file. It typically resides in the
' c:\windows\system directory. Additional declarations for VISA.DLL are usually in the
' visa.bas file in the c:\vxipnp\win31\include directory on your PC. This routine uses the
' VTL Library to send commands to an instrument. A description of these and additional
' VTL commands are contained in the Agilent Technologies Visa Transition Library book
' Agilent Part Number E2094-90002.
'************************************************************************************
Declare Function viOpenDefaultRM Lib "VISA.DLL" Alias "#141" (viDefaultRM As Long) As Long
Declare Function viOpen Lib "VISA.DLL" Alias "#131" (ByVal viDefaultRM As Long, ByVal
viDesc
As String, ByVal mode As Long, ByVal timeout As Long, vi As Long) As Long
Declare Function viClose Lib "VISA.DLL" Alias "#132" (ByVal vi As Long) As Long
Declare Function viRead Lib "VISA.DLL" Alias "#256" (ByVal vi As Long, ByVal Buffer As
String, ByVal count As Long, retCount As Long) As Long
Declare Function viWrite Lib "VISA.DLL" Alias "#257" (ByVal vi As Long, ByVal Buffer As
String, ByVal count As Long, retCount As Long) As Long
Declare Function viClear Lib "VISA.DLL" Alias "#260" (ByVal vi As Long) As Long