EasyManua.ls Logo

Keysight E3632A - Page 169

Keysight E3632A
196 pages
Print Icon
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...
Application Programs 5
Example Program for Excel 5.0 (Windows 3.1 and GPIB)
E3632A User’s Guide 147
If InStr(SCPICmd, "?") Then 'If a query read the response string
errorStatus = viRead(vi, ByVal readbuf, 512, actual)
ReturnString = readbuf
'Strip out any nul's from the response string.
crlfpos = InStr(ReturnString, Chr$(0))
If crlfpos Then
ReturnString = Left(ReturnString, crlfpos - 1)
End If
SendSCPI = ReturnString 'return the remaining string
End If ' end of query to instrument for a response
Exit Function
VIerrorHandler:
'Display the error message in the txtResponse TextBox
MsgBox " I/O Error: " & Error$()
'Close the device session
errorStatus = viClose(vi)
Exit Function
End Function
Sub OpenPort()
Dim VISAaddr As String
'****************************
'Change the GPIB address here
'****************************
VISAaddr = "5"
errorStatus = viOpenDefaultRM(videfaultRM) 'open the visa session
'Open communication to instrument
errorStatus = viOpen(videfaultRM, "GPIB0::" & VISAaddr & "::INSTR",0, 1000, vi)
If errorStatus < VI_SUCCESS Then ' on error give message
Cells(1, 1) = "Unable to Open port"
End If
End Sub
Sub ClosePort()
errorStatus = viClose(vi)
'close the session
errorStatus = viClose(videfaultRM)
End Sub
End of program

Table of Contents

Other manuals for Keysight E3632A

Related product manuals