908
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
12
Programming Examples
End Function
Private Function DoQueryIEEEBlock_Bytes(query As String) As Long
On Error GoTo ErrorHandler
' Send query.
Call ivprintf(id, query + vbLf)
' Read definite-length block bytes.
Call ifread(id, byteArray(), ByteArraySize, vbNull, retCount)
' retCount is now actual number of bytes returned by read.
CheckForInstrumentErrors query
DoQueryIEEEBlock_Bytes = retCount
Exit Function
ErrorHandler:
MsgBox "*** Error : " + Error, vbExclamation
End
End Function
Private Sub CheckForInstrumentErrors(strCmdOrQuery As String)
On Error GoTo ErrorHandler
Dim strErrVal As String * 200
Dim strOut As String
Do
Call ivprintf(id, "SYSTem:ERRor?" + vbLf) ' Request error message.
Call ivscanf(id, "%200t", strErrVal) ' Read: Errno,"Error String".
If Val(strErrVal) <> 0 Then
strOut = "INST Error: " + RTrim(strErrVal) + vbLf
End If
Loop While Val(strErrVal) <> 0
' End if find: 0,"No Error".
If Not strOut = "" Then
MsgBox strOut, vbExclamation, "INST Error Messages, " + _
strCmdOrQuery
Call iflush(id, I_BUF_DISCARD_READ Or I_BUF_DISCARD_WRITE)
End If
Exit Sub
ErrorHandler:
MsgBox "*** Error: " + Error, vbExclamation
End Sub
Summary of Contents for InfiniiVision 7000A Series
Page 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Page 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Page 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Page 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...