Programming Examples

9

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

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Reference

587

Page 587
Image 587
Agilent Technologies 5000 Series manual Programming Examples