Programming Examples 9
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Reference 587
MsgBox "Phase = " + vbCrLf + CStr(dblPhase)
Exit Sub
VisaComError:
MsgBox "VISA COM Error:" + vbCrLf + Err.Description
End Sub
Private Sub CheckForInstrumentErrors()
On Error GoTo VisaComError
Dim strErrVal As String
Dim strOut As String
myScope.WriteString "SYSTEM:ERROR?" ' Query any errors data.
strErrVal = myScope.ReadString ' Read: Errnum,"Error String".
While Val(strErrVal) <> 0 ' End if find: 0,"No Error".
strOut = strOut + "INST Error: " + strErrVal
myScope.WriteString ":SYSTEM:ERROR?" ' Request error message.
strErrVal = myScope.ReadString ' Read error message.
Wend
If Not strOut = "" Then
MsgBox strOut, vbExclamation, "INST Error Messages"
myScope.FlushWrite (False)
myScope.FlushRead
End If
Exit Sub
VisaComError:
MsgBox "VISA COM Error: " + vbCrLf + Err.Description
End Sub