Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 753

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

VisaComError:
End Sub
Private Sub CheckForInstrumentErrors()
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
' Read time at edge 1 on ch 1.
dblChan1Edge1 = myScope.ReadNumber
' Query time at 1st rising edge on ch2.
myScope.WriteString ":MEASURE:TEDGE? +1, CHAN2"
' Read time at edge 1 on ch 2.
dblChan2Edge1 = myScope.ReadNumber
' Calculate delay time between ch1 and ch2.
dblDelay = dblChan2Edge1 - dblChan1Edge1
' Write calculated delay time to screen.
MsgBox "Delay = " + vbCrLf + CStr(dblDelay)
' Make a phase difference measurement between channel 1 and 2.
' Query time at 1st rising edge on ch1.
myScope.WriteString ":MEASURE:TEDGE? +2, CHAN1"
' Read time at edge 2 on ch 1.
dblChan1Edge2 = myScope.ReadNumber
' Calculate period of ch 1.
dblPeriod = dblChan1Edge2 - dblChan1Edge1
' Calculate phase difference between ch1 and ch2.
dblPhase = (dblDelay / dblPeriod) * 360
MsgBox "Phase = " + vbCrLf + CStr(dblPhase)
Exit Sub
MsgBox "VISA COM Error:" + vbCrLf + Err.Description
On Error GoTo VisaComError
Dim strErrVal As String
Dim strOut As String
myScope.WriteString "SYSTEM:ERROR?"
strErrVal = myScope.ReadString
While Val(strErrVal) <> 0
strOut = strOut + "INST Error: " + strErrVal
myScope.WriteString ":SYSTEM:ERROR?"
strErrVal = myScope.ReadString
Wend
If Not strOut = "" Then
MsgBox strOut, vbExclamation, "INST Error Messages"
myScope.FlushWrite (False)
myScope.FlushRead
Programming Examples
' Query any errors data.
' Read: Errnum,"Error String".
' End if find: 0,"No Error".
' Request error message.
' Read error message.
12
753

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents