MDO3000 Programmer Manual.pdf - 第1104页
Appendix E: Mask/Limit Co mmand Sequence Examples Command Comment :MASK:TEST :SA VEIMAGE ON Once the test start s , this command will save a .PNG, .BMP or .TIF fi le (depending upon the setting of SA V e:IMAGe:FILEFormat)…

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

Appendix F: Search and Trigger Command Sequence
Examples
The following are some example command sequences that show a variety of
different searches and triggers. The commands in these sequences are not
order-dependent.
To use these examples, connect channel 1, channel 2, channel 3 and channel 4 to
the probe compensation signal located on the right hand side of the front panel.
The search and trigger command group sections contain more information on
general search and trigger concepts. (See page 2-61, Search Command Group.)
(See page 2-76, Trigger Command Group.)
Example 1: Single Threshold Edge Search
Goal: Search the channel 2 waveform and place a mark at each instance where it
crosse
s below a threshold of 1.4 volts.
Command Comment
*RST Resets the oscilloscope. Wait for the reset to complete
(appr
oximately 3 seconds).
:SEL
ect:CH2 1
Turn
s the CH2 waveform on.
:AUT
OSet EXECute
Auto
sets the displayed waveform CH2. Wait for the autoset to
complete (approximately 3 seconds).
:SEARCH:SEARCH1:TRIGger:A:TYPe EDGE Specifies that this will be an edge search (a mark will be placed
when the s ource waveform passes through a specified threshold
lev
el in the specified direction).
:S
EARCH:SEARCH1:TRIGger:A:EDGE:SOUrce CH2
Sp
ecifies the CH2 waveform as the source wa veform.
:S
EARCH:SEARCH1:TRIGger:A:LOWerthreshold:CH2 1.4
Sp
ecifies 1.4 volts as the threshold level.
:
SEARCH:SEARCH1:TRIGger:A:EDG E:SLOpe FALL
S
pecifies the falling edge as the direction.
:
SEARCH:SEARCH1:STATE 1
Turns the search on.
:SEARCH:SEARCH1:TOTal? Returns 4, indicating that CH2 fell below the 1.4 volt threshold 4
times.
:SEARCH:SEARCH1:LIST? Returns a list of the 4 marks:
CH2,11.2411,11.2411,11.2411,-1.5504E-3,
0.0E+0,0.0E+0,0.0E+0;CH2,37.0737,37.0737,37.0737,
-517.0517E-6,0.0E+0,0.0E+0,0.0E+0;CH2,62.9163,62.9163,62.9163,
516.6517E-6,0.0E+0,0.0E+0,
0.0E+0;CH2,88.7489,88.7489,88.7489,
1.5500E-3,0.0E+0,0.0E+0,0.0E+0
MDO4000/B/C, MSO/DPO4000B and MDO3000 Series Oscilloscopes Programmer Manual F-1