Technical data

Table Of Contents
Programming Examples 12
Agilent InfiniiVision 6000 Series Oscilloscopes Programmer's Guide 899
Dim fResults As Double
fResults = VisaGetResultValue()
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery)
' Return string results.
Return fResults
End Function
Public Function DoQueryValues(ByVal strQuery As String) As Double()
' Send the query.
VisaSendCommandOrQuery(strQuery)
' Get the result string.
Dim fResultsArray As Double()
fResultsArray = VisaGetResultValues()
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery)
' Return string results.
Return fResultsArray
End Function
Public Function DoQueryIEEEBlock(ByVal strQuery As String, _
ByRef ResultsArray As Byte()) As Integer
' Send the query.
VisaSendCommandOrQuery(strQuery)
' Get the result string.
Dim length As Integer
' Number of bytes returned from instrument.
length = VisaGetResultIEEEBlock(ResultsArray)
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(strQuery)
' Return string results.
Return length
End Function
Private Sub CheckForInstrumentErrors(ByVal strCommand As String)
' Check for instrument errors.
Dim strInstrumentError As New StringBuilder(1000)
Dim bFirstError As Boolean = True
Do
VisaSendCommandOrQuery(":SYSTem:ERRor?")
strInstrumentError = VisaGetResultString()
If strInstrumentError.ToString() <> _
"+0,""No error""" & Chr(10) & "" Then
If bFirstError Then
Console.WriteLine("ERROR(s) for command '{0}': ", _
strCommand)
bFirstError = False
End If