MDO3000 Programmer Manual.pdf - 第1102页
Appendix E: Mask/Limit Co mmand Sequence Examples Command Comment Y ou can use the following queries to count the hits and get other information about the test. T otal hits should equal the s um of the SEG1 and SEG2 hits…

Appendix E: Mask/Limit Command Sequence Examples
This section provides some sample mask command sequences that show you
how to accomplish a few typical tasks.
Example 1: Creating custom masks
Goal: Create a custom mask, run a test that stops on violation, and determine
the number
of hits per mask segment.
Command Comment
*RST Re sets the oscilloscope to the factory default settings.
:MASK:CUSTOM INIT This should display a triangle mask with one segm ent using the default horizontal
and verti
cal scope settings. (Note: the default horizontal scale is 4 µsec/div.)
You can v
erify that it’s a custom m ask by querying:
MASK:S
TANDARD?
Should
return CUSTOM .
Next, u
se mask commands to specify the mask parameters:
:MASK
:USER:AMPLitude 100.0000E-3
:MASK:USER:VSCALe 100.0000E-3
:MASK:USER:VPOS 0.0E+0
:MAS
K:USER:VOFFSet 0.0E+0
:MASK:USER:HSCALE 4.0000E-6
:MASK:USER:HTRIGPOS 500.0000E-3
:MAS
K:USER:WIDth 4.0000E-6
:MASK:USER:RECOrdlength 10000
:MASK:USER:TRIGTOSAMP 0.0E+0
Next, substitute a customized mask for the initial mask by creating two blue bands
ac
ross the screen, one above and one below the x-axis.
Note the dimensions of the display are 40e-6 X 10e-3 (10*horizontal_scale X
10*vertical_scale). The num ber of horizontal divisions is 10.
Th
e points in these lists are presented in a c ounter clock-wise manner starting with
the lower # left hand corner (-20e-6, .1) for SEG1 and (-20e-6,-.2) for SEG2:
:MASK:USER:SEG1:POINTS
-20e-6,.1,20e-6,.1,20e-6,.2,-20e-6,.2
:
MASK:USER:SEG2:POINTS
-20e-6,-.2,20e-6,-.2,20e-6,-.1,-20e-6,-.1
Next, force a failure. Generate 100KHz sine wave, amplitude 0.22 volt, offset 0.0.
:ACQUIRE:STATE? Should r eturn 1, indicating that acquisitions are taking place.
:MASK:STOPONVIOLATION ON This command will cause w aveform acquisitions to stop upon the first occurrence of a
waveform violation once the test starts.
:MASK:TEST:STATE ON Starts the test.
:ACQUIRE:STATE? Should now return 0, verifying that waveform acquisitions have stopped.
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual E-1

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