EasyManua.ls Logo

HP 34970A - Page 321

HP 34970A
429 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sub OpenPort()
’""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
’ Be sure that the HP-IB address has been set in the ’VISAaddr’ variable
’ before calling this routine.
’""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
’ Open the VISA session
errorStatus = viOpenDefaultRM(videfaultRM)
’ Open communications to the instrument
errorStatus = viOpen(videfaultRM, "GPIB0::" & VISAaddr & "::INSTR", 0, 2500, vi)
’ If an error occurs, give a message
If errorStatus < VI_SUCCESS Then
Range("A2").Select
Cells(1, 1) = "Unable to Open Port"
End If
End Sub
Sub ClosePort()
errorStatus = viClose(vi)
’ Close the session
errorStatus = viClose(videfaultRM)
End Sub
’""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
’ This subroutine is used to create delays. The input is in seconds and
’ fractional seconds are allowed.
’""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Sub delay(delay_time As Single)
Dim Finish As Single
Finish = Timer + delay_time
Do
Loop Until Finish <= Timer
End Sub
Chapter 7 Application Programs
Example Programs for Excel 7.0
324

Table of Contents

Related product manuals