MDO3000 Programmer Manual.pdf - 第127页
Command Groups T able 2 -44: Example Command Sequence for T ransferri ng Waveform Data from Oscilloscope to Computer (cont.) Item Description :HEADer 1 T urning on HEADer and VERBose will allow you to view the WFMOutpr e…

Command Groups
<binary data> i
s the binary data which should be exactly N-Digits bytes in
length.
NOTE. Ifyouwouldliketosaveorrecallawaveformtoorfromafile, use the
SAVe:WAVEform and RECAll:WAVEform commands.
Transferring a Waveform
from an Oscilloscope to a
Computer
Use the DATa commands and WFMOutpre commands to specify the attributes of
the waveform being transferred from the oscilloscope. You must, at a minimum,
specify the waveform source (using the
DATa:SOUrce command) and data format
(using the
DATa:ENCdg and DATa:WIDth commands).
Then, use the
WFMOutpre? query, which provides the context needed to interpret
the waveform data points. Finally, use the
CURVE? query to transfer the waveform
data points. (You can also use the
WAVFrm? query, which concatenates the
WFMOutpre? and CURVe? queries. )
NOTE. In order to guarantee that the waveform data returned from
CURVE?
queries of multiple waveforms are correlated to the same acquisition, you
should use single sequence acquisition mode to acquire the waveform data
from a single acquisition. Single sequence acquisition mode is enabled using
ACQuire:STOPAfter
SEQuence
.
NOTE. The
WFMOutpre:BYT _Nr
and
WFMOutpre:BIT _Nr
settings are
directly related; setting one causes the other to be set accordingly. For
example,
WFMOutpre:BY T_Nr 2
causes
WFMOutpre_B IT_Nr
to be set to
16 (2 * 8 bits/byte). Similarly, setting
WFMOutpre: BIT_Nr
to 16 causes
WFMOutpre: BYT_Nr
to be set to 2.
Following is an example command sequence that illustrates how to transfer
waveform data from the oscilloscope to the computer.
In this case, let’s say you’d like to transfer 10,000 points from channel 1, in ASCii
format with 1 byte per point, to your computer program.
Table 2-44: Example Command Sequence for Transferring Waveform Data from Oscilloscope to Computer
Item Description
:DATa:SOUrce CH1 Sets the source waveform to be transferred to Channel 1.
:DATa:STARt 1 This, along with DATa:STOP, specifies the portion of the w aveform record that will
be transferred .
:DATa:STOP 10000
:DATa:ENCdg ASCIi Sets the data format to ASCII. (This command replaces WFMOutpre:ENCdg,
WFMOutpre:BN_Fmt
and WFMOutp re:BYT_Or with a single command.)
:DATa:WIDth 1
Sets 1 byte per point (same as
WFMOutpre:BYT_Nr).
2-96 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual

Command Groups
Table 2 -44: Example Command Sequence for Transferring Waveform Data from Oscilloscope to Computer (cont.)
Item Description
:HEADer 1 Turning on HEADer and VERBose will allow you to view the WFMOutpre?
parameters in context.
:VERBose 1
:WFMOutpre? The WFMO utpre? query provides the information needed to interpret the waveform
data point information that will be returned from the
CURVe query.
:HEADer 0
You may want to turn the header off before doing the
CURVe query, because w ith
the header on, a
CURVe query will return the CURVe command header followed by
a space and the ASCII waveform data.
:CURVe? Transfers the data points.
NOTE. Command sequence examples as well as sev eral comprehensive examples
of what the
WFMOutpre?
query might return using different data sources are
includ
ed as an appendix. (See page D-1, Waveform Transfer (WFMOutpre and
CURVe Query) Examples.)
Examp
le 1: Analog Waveform (channel 1 - 4)
Example 2: Digital Waveform (channel DO-D15)
Example 3: The Digital Collection with 4 Bytes Per Point with MagniVu Off
Example 4: The Digital Collection with 8 Bytes Per Point with MagniVu Off
Example 5: The Digital Collection with 4 Bytes Per Point with MagniVu On
Example 6: The Digital Collection with 8 Bytes Per Point with MagniVu On
Ex
ample 7: RF Frequency Domain Waveform
NOTE. Whenyoudoa
WFMOutpre?
query in an interactive session during
p
rogram development, it’s a good idea to first turn on the header and verbose
features (using the
HEADer
and
VERBose
commands) in order to see the returned
values in context.
Waveform Sources. Valid waveform sources that can be transferred from the
oscilloscope (using the
DATa:SOUrce command) include:
CH1–CH4- Analog channels. When
DATa:SOUrce is set to one of these
sources, the data points represent digitizing levels. There are 25 digitizing levels
per vertical division for 1-byte data, and 6400 digitizing levels per vertical
division for 2-byte data. These data points can be transferred in signed or
unsigned integer formats.
D0 – D15 - The digital input channels (MSO/MDO4000/B models only as
well as MDO3000 and MDO4000C series models with options MDO3MSO or
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-97

Command Groups
MDO4MSO instal
led). When
DATa:SOUrce is set to one of these, the data points
are binary states (0 or 1). These data points can be transferred in widths of 1or2
bytes, as signed or unsigned integers.
DIGital - The Digital Collection. These data points are binary states (0 or 1) that
can be transferred in widths of 4 or 8 bytes, as signed or unsigned integers. For
ASCII encoding, the data is transferred as hexadecimal values with leadingzeroes
suppressed. When
DATa:SOUrce is set to DIGital, this represents a collection
of information that differs dependingonthedatawidth(setusingeitherthe
DATa:WIDt
h
or WFMOutpre:BYT_Nr command.)
When the data width is set to 4 bytes, the Digital Collection is the states of
digital c
hannels D0 – D15, plus the digital representations of analog channels
1 – 4, plus the trigger state.
When the
data width is set to 8 bytes, the Digital Collection is the transition
state information for digital channels D0 – D15, plus the digital representations
of analog channels 1 – 4. For more information, see the section below
“Further Explanation of Digital Collection Data”. (MSO/MDO4000/B models
only as well as MDO3000 and MDO4000C series models with options
MDO3MSO or MDO4MSO installed).
RF_NORMal, RF_AVErage, RF_MAXHold, RF_MINHold -thesearetheRF
frequency domain traces (MDO4000/B/C and MDO3000 models only). When
DATa
:SOUrce
is set to one of these traces, the data points represent the amplitude
of the trace in watts, and are floating point values. The frequency domain trace
data is returned as 4-byte floating point values. (Note that
CURVe? always returns
linear watts, not the display units.)
RF_AMPlitude, RF_FREQuency, RF_PHASe – these are the RF time domain
traces (MDO4000/B/C series models only.) When
DATa:SOUrce is set to one of
these traces, the data points are the Amplitude vs. Time, Frequency vs. Time, or
Phase vs. Time representations of the RF input signal.
The RF time domain traces are returned as 1-byte or 2-byte integers, depending
on the
DATa:WIDth setting. The default is 1 byte per point.
RF_FREQuency – frequency in Hz.
RF_PHASe – phase in degrees.
RF_AMPlitude – amplitude in Volts.
MATH — The format of MATH data is dependent upon the sources for the math
waveform. For analog channel sources, the format is that for the analog channels
described above. For spectrum math, the format is the same as for RF frequency
domain traces, which is 4-byte floating point data.
REF1-REF4 — The format of REF data is dependent upon the sources from
which the reference waveform was created. For analog channel sources, the
format is that for the analog channels described above. For RF frequency domain
2-98 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual