MDO3000 Programmer Manual.pdf - 第630页

Commands Listed in A lphabetical Order from the instru ment. Please reference the MA T -F ile Format document for detailed information about the file header and data elements. The 128-byte header is comprised of the follo…

100%1 / 1158
Commands Listed in Alphabetical Order
Menu->save wav
eform menu. The type of file saved is dependent upon the
SAVe:WAVEform:FILEFormat command.
For instrumen
ts with the arbitrary waveform feature, the source can be arbitrary
waveform edit memory (EMEM) or one of the internal arbitrary waveform
locations (ARB1 - ARB4).
Specifying ALL saves all displayed waveforms, depending upon the specified
SAVe:WAVEform:FILEFormat, to the specified destination path. ALL can onlybe
used to save all waveforms to a single CSV file (SAVe:WAVEform:FILEFormat
SPREADSheet) or to individual ISF files with the path and file name prefix
specified by <file path> (SAVe:WAVEform:FILEFormat INTERNal). It cannot be
used to sa
ve to a reference memory slot.
With the INTERNal format, all displayed waveforms, excluding digital
wavefor
ms (D0-15) are saved to files in the specified destination path named as
<file path>_<wfm>.isf.
Arbitr
ary waveforms EMEM, ARB1 - ARB4 are not saved with the
:SAVe:WAVEform ALL, <file> command.
For ex
ample: With CH1,CH2 and MATH only displayed, the command
:SAVE:WAVEFORM ALL,"E:/MyWaveforms/Test1"
saves
CH1 to E:/MyWaveforms/Test1_CH1.isf
CH2 to E:/MyWaveforms/Test1_CH2.isf
MATH to E:/MyWaveforms/Test1_MATH.isf
Fo
r SPREADSheet format, the displayed waveforms are saved to a single CSV
file.
At
tempting to save a waveform to itself, such as: :
SAVe:WAVEform REF1,REF1
:SAVe:WAVEform ARB1,ARB1
results in an error event: 100,"Command error; Source and destination are the
same; ..
The MATLAB Level 5 file format description is as follows:
The RF_BB_IQ data can be exported to a file in a format that is readable by
MATLAB when RF_BB_IQ is saved with the MATLAB file format, which
is specified using :SAVe:WAVEform:FILEFormat:RF_BB_IQ MATLAB.
The MATLAB file format is the Level 5 format described in the "MAT-File
Format R2013a" document available from the MathWorks web site at
http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf. This
section describes our use of the Level 5 format for the export of RF_BB_IQ data
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-599
Commands Listed in Alphabetical Order
from the instru
ment. Please reference the MAT-File Format document for detailed
information about the file header and data elements.
The 128-byte header is comprised of the following fields:
Descriptive Text (116 bytes):
MATLAB 5.0 MAT-file, Platform: <ID>, Created on: <date>
where:
<ID> is the instrument ID string of the form:
TEK/MSO4104B/SN C0
01023/FV v2.97061
<date> is the date/time of the form:
Tue Aug 6 18:30:28 2013
This 116-byte field is padded at the end with spaces.
Subsystem Data Offset (8 bytes):
This is always written as 8 ASCII spaces (0x20).
Version (2 bytes):
This is the MATLAB file format version number and is always written as
0x0100.
How this is read is determined by the next field.
Endian Indicator (2 bytes):
This is written as a 16-bit value of ('M' << 8) | 'I' and is used by the reader to
determine whether byte swapping is needed. If it reads as MI, then no byte
swapping is needed.
The pertinent instrument set
tings, comprised of center frequency, span and sample
rate are written as miMATRIX elements. Each of these elements have an ASCII
name and the values are miDOUBLE:
CenterFreq is the center frequency in hertz.
Span is the frequency span in hertz.
SampleRate is the sampling rate in samples per second.
Each of these is written as an miMATRIX element, a complex record of the
following format:
Array Type (4 bytes) = miMATRIX (14)
Array Size (4 bytes) = 56 + nameLen + padding
nameLen is the string length of the name
padding = (8 - (nameLen % 8)) % 8
2-600 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual
Commands Listed in Alphabetical Order
Type of Array Fl
ags (4 bytes) = miUINT32 (6)
Size of Array Flags (4 bytes) = 8
Array Flags (8 bytes) = 0 0 0 mxDOUBLE_CLASS=6 0 0 0 0
Dimensions Array Type (4 bytes) = miINT32 (5)
Dimensions Array Length (4 bytes) = 8
X Dimension (4 bytes) = 1
Y Dimension (4 bytes) = 1
Array Name Type (4 bytes) = miINT8 (1)
Array Name Length (string length of name - e.g. 10 for CenterFreq)
Array Name (including pad bytes which are 0's) (see Array Size above)
Array Data Element Type (4 bytes) = miDOUBLE (9)
SizeofArray(4bytes)=8
The Instrument Setting Value (8 bytes)
Pad Bytes: 0 or more 0 bytes to end the record on an 8-byte boundary
The actual IQ data record with values written as single precision floating point
values (miSINGLE):
The I data array is written first:
Array Type (4 bytes) = miSINGLE (7)
Array Size (4 bytes) = 56 + nameLen + padding
nameLen is the string length of the name
padding = (8 - (nameLen % 8)) % 8
Type of Array Flags (4 bytes) = miUINT32 (6)
Size of Array Flags (4 bytes) = 8
Array Flags (8 bytes) = 0 0 miFLAGS_COMPLEX=8 mxSINGLE_CLASS=7
0000
Dimensions Array Type (4 bytes) = miINT32 (5)
Dimensions Array Length (4 bytes) = 8
X Dimension (4 bytes) = number of IQ samples (IQ record length)
Y Dimension (4 bytes) = 1
Array Name Type (4 bytes) = miINT8 (1)
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual 2-601