Agilent Technologies InfiniiVision 7000A Series Programmer's Manual page 820

Table of Contents

Advertisement

12
Programming Examples
820
FormatNumber(sngYOrigin) + " V" + vbCrLf
strOutput = strOutput + "Sec/Div = " + _
FormatNumber(lngPoints * dblXIncrement / 10 * _
1000000) + " us" + vbCrLf
strOutput = strOutput + "Delay = " + _
FormatNumber(((lngPoints / 2) * _
dblXIncrement + dblXOrigin) * 1000000) + " us" + vbCrLf
' QUERY_WAVE_DATA - Outputs waveform data that is stored in a buffer.
' Query the oscilloscope for the waveform data.
myScope.WriteString ":WAV:DATA?"
' READ_WAVE_DATA - The wave data consists of two parts: the header,
' and the actual waveform data followed by a new line (NL) character.
' The query data has the following format:
'
'
<header><waveform_data><NL>
'
' Where:
'
<header> = #800001000 (This is an example header)
' The "#8" may be stripped off of the header and the remaining
' numbers are the size, in bytes, of the waveform data block.
' size can vary depending on the number of points acquired for the
' waveform.
You can then read that number of bytes from the
' oscilloscope and the terminating NL character.
'
Dim lngI As Long
Dim lngDataValue As Long
' Unsigned integer bytes.
varQueryResult = myScope.ReadIEEEBlock(BinaryType_UI1)
For lngI = 0 To UBound(varQueryResult) _
Step (UBound(varQueryResult) / 20)
If intBytesPerData = 2 Then
lngDataValue = varQueryResult(lngI) * 256 + _
varQueryResult(lngI + 1)
Else
lngDataValue = varQueryResult(lngI)
End If
strOutput = strOutput + "Data point " + _
CStr(lngI / intBytesPerData) + ", " + _
FormatNumber((lngDataValue - lngYReference) * sngYIncrement + _
sngYOrigin) + " V, " + _
FormatNumber(((lngI / intBytesPerData - lngXReference) * _
dblXIncrement + dblXOrigin) * 1000000) + " us" + vbCrLf
Next lngI
MsgBox "Waveform data:" + vbCrLf + 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
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
' 20 points.
' 16-bit value.
' 8-bit value.
The

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents