MDO3000 Programmer Manual.pdf - 第1103页
Appendix E: Mask/Limit Command Sequence Examples Command Comment Now , you may save your custom mask. Y ou can save either the mask de fi nition itself, or the mask de fi nition plus the rest of the scope settings. In both…

Appendix E: Mask/Limit Command Sequence Examples
Command Comment
You can use the following queries to count the hits and get other information about
the test. Total hits should equal the s um of the SEG1 and SEG2 hits.
:MASK:COUN T:HITS?
:MASK:COUNT
:SEG1:HITS?
:MASK:COUNT:SEG2:HITS?
:MASK:COUNT:TOTAL?
:MASK:COUN
T:VIOLATIONS?
:MASK:COUNT:WAVEFORMS?
:MASK:COUNT:VIOLATIONS? should return 1, since stoponviolation was set.
Example 2:
Modifyinganexistingmask
Goal: Modify an existing standard mask, save the modified mask, then recall
the modified mask.
NOTE. Th
is example does not apply for MDO3000 series models.
Command Comment
*RST Resets the oscilloscope to the factory default settings.
:MASK:STANDARD DS1C This command displays a standard DS1C mask.
:MASK:STANDARD? Should return D S1C.
:MASK:CUSTOM COPYACTIVE
This c
ommand copies the currently displayed mask and designates it as a custom mask.
:MASK:STANDARD? Should now return CUSTOM.
You can query to find out the points of each segment:
:MASK:USER:SEG1:PO INTS? Should return -155.3300E-9,420.0000E-3,-41.2100E-9,420.0000E-3,
-6.3400E-9,2.1000,-6.3400E-9,4.6200,82.4200E-9,4.6200,82.4200E-9,4.4100,
17
1.1800E-9,4.4100,171.1800E-9,2.1000,206.0500E-9,420.0000E-3,
320.1700E-9,420.0000E-3,320.1700E-9,6.3000,-155.3300E-9,6.3000
:MASK:USER:SEG2:PO INTS? Should return -155.3300E-9,-2.1000,320.1700E-9,-2.1000,320.1700E-9,
-420.0000E-3,152.1600E-9,-420.0000E-3,152.1600E-9,2.1000,114.1200E-9,
3
.9900,50.7200E-9,3.9900,12.6800E-9,2.1000,12.6800E-9,-420.0000E-3,-155.3300E-9,
-420.0000E-3
:MASK:USER:SEG3:PO INTS? Should return 0.0E+0,0.0E+0 since this mask has only 2 segments.
Next, you can modify the mask.
:MASK:USER:SEG2 DELETE The bottom segment of the m ask (segment 2) should disappear from the display.
:MASK:USER:SEG2:PO INTS? Should now return 0.0E+0,0.0E+0.
Create a new segment 2:
:MASK:USER:SEG2:PO INTS
[Enter new points for segment 2
here]
The MASK:USER:SE G2:POINTS command specifies the X-Y coordinate pairs of all points i n
the specified segment, using waveform units. There can be up to 8 s egments.
A new segment 2 should appear on the display.
E-2 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual

Appendix E: Mask/Limit Command Sequence Examples
Command Comment
Now, you may save your custom mask. You can save either the mask definition itself, or the
mask definition plus the rest of the scope settings. In both cases, the information is saved to
the current wo
rking directory.
:SAVE:MASK '
”FOO.MSK”
or SAVE:S ETU
P “FOO.SET'”
To recall th
e mask, use the commands RECAll:MASK “FO O.MSK” or RECAll:SETUP
“FOO.SET”
Example 3:
Creating a limit (template) mask
Goal: Create a limit (template) mask and then, upon violation, save the waveform
data and image to a USB device or a network drive.
Command Comment
First, install a USB m ass storage device into one of the available slots on the instrument or
mount a network drive. The DPO/MSO4000B series has 2 US B host ports (“E:” and “F:”) on
the front of the instrument and 2 USB host ports (“G:” and “H:”) on the rear of the instrument.
The MDO3000 series has one USB host port on the front (E:) and one on the back (F:).
Additionally, they support mounting network drives as “I:” through “Z:” (See the command
FILESystem:MOUNT:DRIve for more information).
The default working directory for file system access via the programmatic i nterface is “E:”.
You can create a directory on that drive if desired by using the FILESystem:MKDIR command.
For example, FILESys:MKDIR “E:/MyMaskTestWaveforms”.
Next, set the current working directory (CWD) to the drive/directory that you desire to have the
waveform file saved to. For examp le FILESystem:CWD “E:/MyMaskTestWaveforms”.
# Next, select the type of waveform file you desire to save: SPREADSheet or INTERNal using
the SAVe:WAVEForm:FILEFormat {SPREADSheet | INTERNal} command. See the command
SAVe:WAVEForm:FILEFormat for more information.
*RST Resets the oscilloscope to the factory default settings.
:APPLICATION:TYPE LIMITMASK
This sets the application type to limit mask.
:MASK:TEMPLATE:SOURCE CH1 This command specifies the source waveform to be used to create a template mask. The
source can be either one of four channels, or one of four saved reference waveforms
Generate a 300KHz sine wave, 0.2 volt peak to peak, with no offset. Position the waveform
so that the signal is centered in the screen.
Now, create a template mask, which will be based on the settings of the
MASK:TEMPLate:SOUrce, MASK:TEMPLate:TOLerance:HORizontal, and
MASK:TEMPLate:TOLerance:VERTical commands. (If you do not specify the horizontal or
vertical tolerances, the default tolerance of one minor division will be used.)
:MASK:TEMPLATE:CREAT EMASK
The limit mask should appear on the screen.
:MASK:STOPONVIOLATION ON This command will stop the waveform acquisitions upon the first occurrence of a waveform
violation.
:MASK:TEST:SAVEWFM ON Once the test starts, this command will save an ISF or CSV file (depending upon the setting of
(SAVe:WAVEForm:FILEFormat) of the waveform from C hannel 1 upon mask violation to a file
# in the current working directory.
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual E-3

Appendix E: Mask/Limit Command Sequence Examples
Command Comment
:MASK:TEST:SAVEIMAGE ON Once the test starts , this command will save a .PNG, .BMP or .TIF file (depending upon the
setting of SAVe:IMAGe:FILEFormat) of the waveform from Channel 1 upon mask violation to a
file in the curr
ent working directory.
:MASK:TEST:
STATE 1
This starts the test.
Next, force
a mask violation. Generate a 300KHz sine wave, 0.22 volt Peak to peak, 0.0 offset.
:ACQUIRE:S
TATE?
This query should return 0, indicating that the acquisitions have stopped, because a violation
has taken pl
ace.
:FILESYST
EM:DIR?
This query
should show that a new waveform and a new screen image file have been saved to
the current working directory.
E-4 MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual