Programming Examples 40
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide 1155
On Error GoTo VisaComError
Dim strErrors As String
myScope.WriteIEEEBlock command, data
CheckInstrumentErrors
Exit Sub
VisaComError:
MsgBox "VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + _
Err.Source + ","+_
Err.Description, vbExclamation, "VISA COM Error"
End
End Sub
Private Function DoQueryString(query As String) As String
On Error GoTo VisaComError
myScope.WriteString query
DoQueryString = myScope.ReadString
CheckInstrumentErrors
Exit Function
VisaComError:
MsgBox "VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + _
Err.Source + ","+_
Err.Description, vbExclamation, "VISA COM Error"
End
End Function
Private Function DoQueryNumber(query As String) As Variant
On Error GoTo VisaComError
myScope.WriteString query
DoQueryNumber = myScope.ReadNumber
CheckInstrumentErrors
Exit Function
VisaComError:
MsgBox "VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + _
Err.Source + ","+_
Err.Description, vbExclamation, "VISA COM Error"
End
End Function
Private Function DoQueryNumbers(query As String) As Variant()
On Error GoTo VisaComError