Programming Examples
9
Agilent 6000 Series Oscilloscopes Programmer's Reference
613
CStr(lngI / intBytesPerData) + ", " + _
FormatNumber((lngDataValue - lngYReference) * sngYInc _
sngYOrigin) + " V, " + _
FormatNumber(((lngI / intBytesPerData - lngXReference) * _
dblXInc dblXOrigin) * 1000000) + " us" + vbCrLf
Next lngI
MsgBox "Waveform data:" + strOutput
' Make a delay measurement between channel 1 and 2.
Dim dblChan1Edge1 As Double
Dim dblChan2Edge1 As Double
Dim dblChan1Edge2 As Double
Dim dblDelay As Double
Dim dblPeriod As Double
Dim dblPhase As Double
' Query time at 1st rising edge on ch1.
err = viVPrintf(vi, ":MEASURE:TEDGE? +1, CHAN1" + vbLf, 0)
' Read time at edge 1 on ch 1.
err = viVScanf(vi, "%lf", VarPtr(dblChan1Edge1))
' Query time at 1st rising edge on ch2.
err = viVPrintf(vi, ":MEASURE:TEDGE? +1, CHAN2" + vbLf, 0)
' Read time at edge 1 on ch 2.
err = viVScanf(vi, "%lf", VarPtr(dblChan2Edge1))
' Calculate delay time between ch1 and ch2.
dblDelay = dblChan2Edge1 - dblChan1Edge1
' Write calculated delay time to screen.
MsgBox "Delay = " + CStr(dblDelay)
' Make a phase difference measurement between channel 1 and 2.
' Query time at 1st rising edge on ch1.
err = viVPrintf(vi, ":MEASURE:TEDGE? +2, CHAN1" + vbLf, 0)
' Read time at edge 2 on ch 1.
err = viVScanf(vi, "%lf", VarPtr(dblChan1Edge2))
' Calculate period of ch 1.
dblPeriod = dblChan1Edge2 - dblChan1Edge1
' Calculate phase difference between ch1 and ch2.
dblPhase = (dblDelay / dblPeriod) * 360
MsgBox "Phase = " + CStr(dblPhase)
End Sub
Содержание DSO6014A/L
Страница 1: ...A Agilent 6000 Series Oscilloscopes Programmer s Reference...
Страница 16: ...16 Agilent 6000 Series Oscilloscopes Programmer s Reference...
Страница 30: ...30 Agilent 6000 Series Oscilloscopes Programmer s Reference 1 What s New...
Страница 540: ...540 Agilent 6000 Series Oscilloscopes Programmer s Reference 6 Error Messages...
Страница 562: ...562 Agilent 6000 Series Oscilloscopes Programmer s Reference 7 Status Reporting...
Страница 584: ...584 Agilent 6000 Series Oscilloscopes Programmer s Reference 8 More About Oscilloscope Commands...
Страница 624: ...624 Agilent 6000 Series Oscilloscopes Programmer s Reference 9 Programming Examples...