MDO3000 Programmer Manual.pdf - 第130页
Command Groups NOTE. The WFMIn pre:BYT_Nr and WFMInpre:BI T_N r settings are directly r elated; setting one causes the other to be set accordingly . For example, WFMInpre:B YT_ Nr 2 causes WFMInpre_B IT_ Nr t ob es e tt …

Command Groups
sources, the fo
rmat is that for the RF frequency domain traces, which is 4-byte
floating point data.
NOTE. When you change the
DATa:SOUrc e
setting, all of the associated settings
for the waveform preamble (
WFMOutpre
commands) are automatically adjusted
for the specified source waveform. The specified source waveform must be turned
on.
Data Encoding and Widths. Data transferred from the oscilloscope using the
CURVe query can be sent in either ASCII or binary formats. ASCII data is sent as
a comma-separated list of decimal values. Binary data is sent with the IEEE488.2
binary block header, immediately followed by the binary data.
You can specify the format for waveform transfers from the oscilloscope
using the combination of
WFMOutpre:ENCdg, WFMOutpre:BN_Fmt and
WFMOutpre:BYT_Or commands. Or else you can simply use the DATa:ENCdg
comman
d, which combines all three.
ASCII data is represented by signed integer values for analog and digital
chann
els and by 4-byte floating point values for the RF frequency domain traces
(RF_NORMal, RF_AVErage, RF_MAXHold, RF_MINHold). The range of the
values depends on the data width (specified using the
WFMOutpre:BYT-Nr or
DATa:WIDth command). One byte wide data ranges from -128 to 127. Two byte
wide data ranges from -32768 to 32767. For digital channels D0 through D15, the
values returned are 0 or 1. For the Digital Collection, ASCII data is returned in
hex
adecimal format with any leading zeroes omitted.
Transferring a Waveform
from a Computer to an
Oscilloscope’s Internal
Reference Memory
Waveforms sent from a computer program TO the oscilloscope are always
stored in one of the internal reference memory locations (REF1-4). Use
DA
Ta:DESTination
to specify the reference memory location, as well other
DATa commands to specify record start and stop points. Next, use the WFMInpre
commands to specify the waveform’s data format, scale, domain and other
attributes that will be used to convert raw data points into the scope's internal
waveform points. Then, use
WFMInpre? to verify your settings. Finally, use the
CURVe command to transfer the raw data points.
Following is an example command sequence that illustrates how to transfer
waveform data to the oscilloscope’s internal reference memory.
In this case, let’s say you have created a waveform on your computer and would
like to transfer 10,000 data points of it, in ASCii format with 1 byte per point, to
your oscilloscope’s internal reference memory location REF2.
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-99

Command Groups
NOTE. The
WFMIn
pre:BYT_Nr
and
WFMInpre:BI T_Nr
settings are directly
related; setting one causes the other to be set accordingly. For example,
WFMInpre:B YT_Nr 2
causes
WFMInpre_B IT_Nr
tobesetto16(2*8bits/byte).
Similarly, setting
WFMInpre:BIT _Nr
to 16 causes
WFMInpre:B YT_Nr
to be
set to 2.
Table 2-45:
Example Command Sequence for Transferring Waveform Data from Computer to Oscilloscope
Item Descriptio
n
:DATa:DES
Tination REF2
Selects RE
F 2 as the internal reference memory location that the incoming
waveform will be transferred to.
:DATa:STARt 1 This, along with DATa:STOP, specifies the starting and ending points of the
waveform record that will be transferred to REF2.
:DATa:STOP
10000
:WFMInpre:DOMain TIMe Speci fies that the data to be transferred is a time domain w aveform, and
therefo
re should be treated as integers (as opposed to a frequency domain
waveform, which uses floating point).
:WFMIn
pre:BYT_Nr 1
Sets the number of bytes per data point in the waveform data to be sent
to RE F2 to 1.
:WFMInpre:BIT_Nr 8
Sets the number of bits per binary data point to 8.
:WFMInpre:ENCdg ASCII Specifies that the incoming waveform uses the A SCII format.
:WFMInpre:NR_Pt 10000
Sets the number of data points that are being sent to REF2 to 10000.
:WFMInpre:PT_Fmt Y
Specifies that the incoming waveform is a normal one, where one ASCII
or b
inary data point is transmitted for each point in the waveform record
(as opposed to envelope).
:WFMInpre:XUNit "S" Sets the horizontal units of the x-axis of the data points to seconds.
:W
FMInpre:XINcr 4.0000E-9
Sets the horizontal interval between the incoming waveform points, using the
units specified above.
:WFMInpre:XZERo -20.0000E-6
Sets the position value of the first data point in the incoming waveform record.
:WFMInpre:YUNit "V"
Specifies that Volts are the v ertical units of the data points being sent.
:WFMInpre:YMUlt 4.0000E-3
Specifies the vertical scale multiplying factor used to convert the incoming
data points from digitizing levels into the units specified above.
:WFMInpre:YOFf 0.0E+0 Specifies that the vertical position in digitizing levels of the incoming reference
waveform is 0.
:WFMInpre:YZEro 0.0E+0
Specifies that the vertical offset of the incoming waveform is 0.
:HEADer 1 Turning on HEADer and VERBose will allow the WFMInpre? parameters
to be viewed in context.
:VERBose 1
:WFMInpre? Do this query to verify your settings.
:CURVe <10,000 AS CIi data points, each separated
by a comma>
Sends the data points to REF2.
2-100 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual

Command Groups
Scaling Waveform Data
Once you transf
er waveform data from an oscilloscope to a computer, you can
convert the data points (which are digitizing levels) into engineering units such as
Volts or Amps for analysis using information from the waveform preamble.
The following is an example for converting transferred data into the appropriate
engineering units. The transfer data is from an analog waveform in YT (single
point) format. (See WFMInpre:PT_Fmt for the definition of the point
formats.)
The data points returned from the
CURVE? query for analog channel data are in
digitizing levels. The YMULT value is in vertical units (e.g. volts) per digitizing
level.
Formula for computing horizontal (time) point value:
X
i
= XZEro + XINcr * (i - 1)
Formula for computing vertical (amplitude) point value:
Y
i
= YZEro + (YMUlt * DataPoint
i
)
where:
i is the index of a curve data point (1–based: first data point is point number 1)
X
i
is the ith horizontal value in XUNits
Y
i
is the ith vertical value in YUNits
DataPoint
i
is the waveform data point value, in digitizing levels.
Commands used:
:DATa:SOUrce CH1
:DATa:START 1
:DATa:STOP 1000
:WFMOutpre:NR_pt? 1000
:WFMOutpre:XUNit? “s”
:WFMOutpre:XZEro? -500.000E-3
:WFMOutpre:XINcr? 1.0000E-3
:WFMOutpre:YUNit? “V”
:WFMOutpre:YZEro? 0.0E+0
:WFMOutpre:YMUlt? 4.0000E-3
:WFMOutpre:BYT_nr? 1
Horizontal (time) values:
X
i
=XZEro+XINcr*(i-1)
=-500ms+1ms*(i–1)
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-101