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

Table of Contents

Advertisement

Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
'
' Where:
'
'
<header> = #800002048
'
' The "#8" may be stripped off of the header and the remaining
' numbers are the size, in bytes, of the waveform data block.
' The size can vary depending on the number of points acquired
' for the waveform which can be set using the
' ":WAVEFORM:POINTS" command.
' of bytes from the oscilloscope; then, read the following NL
' character to terminate the query.
' Read waveform data.
ResultsArray = myScope.DoQueryIEEEBlock(":WAVeform:DATA?")
nBytes = ResultsArray.Length
Console.WriteLine("Read waveform data ({0} bytes).", nBytes)
' Make some calculations from the preamble data.
Dim fVdiv As Double = 32 * fYincrement
Dim fOffset As Double = fYorigin
Dim fSdiv As Double = fPoints * fXincrement / 10
Dim fDelay As Double = (fPoints / 2) * fXincrement + fXorigin
' Print them out...
Console.WriteLine("Scope Settings for Channel 1:")
Console.WriteLine("Volts per Division = {0:f}", fVdiv)
Console.WriteLine("Offset = {0:f}", fOffset)
Console.WriteLine("Seconds per Division = {0:e}", fSdiv)
Console.WriteLine("Delay = {0:e}", fDelay)
' Print the waveform voltage at selected points:
Dim i As Integer = 0
While i < nBytes
Console.WriteLine("Data point {0:d} = {1:f6} Volts at " + _
"{2:f10} Seconds", i, _
(CSng(ResultsArray(i)) - fYreference) * fYincrement + _
fYorigin, (CSng(i) - fXreference) * fXincrement + fXorigin)
i = i + (nBytes / 20)
End While
' SAVE_WAVE_DATA - saves the waveform data to a CSV format
' file named "waveform.csv".
If File.Exists("c:\scope\data\waveform.csv") Then
File.Delete("c:\scope\data\waveform.csv")
End If
Dim writer As StreamWriter = _
File.CreateText("c:\scope\data\waveform.csv")
For index As Integer = 0 To nBytes - 1
writer.WriteLine("{0:E}, {1:f6}", _
(CSng(index) - fXreference) * fXincrement + fXorigin, _
(CSng(ResultsArray(index)) - fYreference) * fYincrement _
+ fYorigin)
Next
writer.Close()
Console.WriteLine("Waveform data ({0} points) written to " + _
Programming Examples
(this is an example header)
You may then read that number
12
841

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents