Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1385
On Error GoTo VisaComError
Dim strErrors As String
myScope.WriteIEEEBlock command, data
CheckInstrumentErrors
Exit Sub
VisaComError:
MsgBox "VISA COM Error: " + CStr(Err.Number) + ", " + _
Err. ", " + _
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: " + CStr(Err.Number) + ", " + _
Err. ", " + _
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: " + CStr(Err.Number) + ", " + _
Err. ", " + _
Err.Description, vbExclamation, "VISA COM Error"
End
End Function
Private Function DoQueryNumbers(query As String) As Variant()
On Error GoTo VisaComError