EasyManua.ls Logo

Keysight 34420A - Page 256

Keysight 34420A
307 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...
6 Application Programs
252 Keysight 34420A User’s Guide
... continued The following subroutine may be included in the GLOBAL.BAS file.
’ GPIB.DLL Access
’ Put into your GLOBAL.BAS file
·
·
·
Global isc As Long
Global device As Long
Global hGpib As Integer
Global errnum As Integer
Sub check_srq ()
condition = 1
’ Display any errors caused by the return of an GPIB command.
If errnum% <> NOERROR Then
MsgBox ("Error = " + GpibErrStr$(errnum%))
End If
’ Wait for the completion of the current command.
errnum% = GpibOutPutS(hGpib%, device&, "*OPC?", 5)
errnum% = GpibEnter(hGpib%, device&, done!)
’ If there is an error bit set, obtain the error.
errnum% = GpibSpoll(hGpib%, device&, response%)
If response% And 32 Then
syst_err$ = "SYST:ERR?"
errnum% = GpibOutPutS(hGpib%, device&, syst_err$, Len(syst_err$))
errnum% = GpibEnter(hGpib%, device&, errx!)
actual% = 80
MsgBox ("Error=" + Str$(errx!))
errnum% = GpibOutPutS(hGpib%, device&, "*CLS", 4)
End If
’ Obtain other GPIB errors.
errnum% = GpibStatus(hGpib%, isc&, condition, Status%)
If errnum% <> NOERROR Then
MsgBox ("Error = " + GpibErrStr$(errnum%))
End If
If Status% = 1 Then
errnum% = GpibSpoll(hGpib%, device&, Status%)
If errnum% <> NOERROR Then
MsgBox ("Error = " + GpibErrStr$(errnum%))
End If
End If
End Sub

Table of Contents

Related product manuals