RIGOL is a registered trademark of RIGOL (SUZHOU) TECHNOLOGIES INC.
Publication Number
PGA18106-1110
Software Version
00.03.04.SP2
Software upgrad e might change o r add pro duct f eatu res . Pl ease ac qu ire th e l atest v ers ion of th e manu al
from RIGOL website or contact RIGOL to upgrade the software.
Notices
RIGOL products are covered by P.R.C. and foreign patents, issued and pending.
RIGOL r eserves the right to m odify or chan ge parts of or all the specifications and pricing policies at
the company’s sole decision.
Information in this publication replaces all previously released materials.
Information in this publication is subject to change without notice.
RIGOL shall not be liable for either incidental or cons equential losses in connection with the
furnishi ng , use, or performance of this manual, as well as any information contained.
Any part of this document is forbidden to be copied, photocopied, or rearranged without prior written
approval of RIGOL.
Product Certification
RIGOL guarantees that this product conforms to the national and industrial standards in China as well as
the ISO9001:2015 standard and the ISO14001:2015 standard. Other international standard conf ormance
certifications are in progress.
Contact Us
If you have any pro blem or requirement when using our products or this manual, please contact RIGOL.
E-mail: service@rigol.com
Website: www.rigol.com
MSO2000A/DS2000A Programming Guide I
RIGOL
Document Overview
This manual provides guidance on how to use the SCPI commands in programming to realize remote
control of RIGOL MSO2000A/DS2000A series digital oscilloscope through the remote interface.
MSO2000A/DS2000A can communicate with a PC through the USB, LAN, or GPI B (with the USB-GPIB
interface converter provided by RIGOL) interface.
Main Topics in this Manual:
SCPI Overview
Command System
Programming Demos
Content Conventions in this Manual :
MSO2000A/DS2000A series includes the following models. Unless otherwise noted, this manual takes
MSO2302A-S as an example to illustrate the functions and using method of the command system of
MSO2000A/DS2000A series.
Visual C++ 6.0 Programming Demo ......................................................................................... 3-15
X MSO2000A/DS2000A Programming Guide
1 SCPI Overview RIGOL
1 SCPI Overview
SCPI (Standard Commands for Programmable Instruments) is a standardized instrument programming
language that is built upon the standard IEEE 488.1 and IEEE 488.2 and conforms to various standards
(such as the float ing point operation rule in IEEE 754 standard, ISO 646 7-bit coded character for
information interchange (equivalent to ASCII programming)). The SCPI commands provide a hierarchical
tree structure and consist of multiple subsystems. Each command subsystem consists of a root keyword
and one or more sub-keywords.
The topics of this chapter:
Syntax
Symbol Description
Parameter Type
Command Abbreviation
Syntax
The command string usually starts with ":"; the keywords are separated by ":" and are followed by the
parameter settings available; "?" is added at the end of the command string to indicate query or execute
the corresponding function and then make query (for example, *TST?); the command keywords and the
first parameter are separated by a space.
For example,
:CALCulate:ADVanced:EXPRession <expression>
:CALCulate:ADVanced:EXPRession?
CALCulate is the root keyword of the command. ADVanced and EXPRession are the second-level and
third-level keywords respectively. The command string starts with ":" which is also used to separate the
multiple-level keywords. <expression> represents the parameters available for setting. "?" represents
query. The command keywords :CALCulate:ADVanced:EXPRession and parameter <expression> are
separated by a space.
"," is generally used for separating multiple parameters contained in the same command, for example,
:SYSTem:DATE <yea r>,<month >, <da y >
MSO2000A/DS2000A Programming Guide 1-1
RIGOL1 SCPI Overview
Symbol Description
The following symbols will not be sent with the commands.
1.Braces {}
The parameters enclo sed in the b races are optio nal and are u sually separ ated by th e v ertical bar "|".
When you use the command, one of the parameters must be selected.
2.Vertical Bar |
The vertical bar is used to separate mu ltiple paramet ers and one of the parameters must be selected
when you use the command.
3.Square Brackets []
The content in the square brackets can be omitted.
4.Triangle Brackets <>
The parameter enclosed in the triangle brackets must be replaced by an effective value.
Parameter Type
1. Bool
The parameter could be ON, OFF, 1 or 0. For example,
:MEASure:ADISplay <bool >
:MEASure:ADISplay?
Wherein, <bool> can be set to {{1|ON}|{0|OFF}}.
The query returns 1 or 0.
2.Discrete
The parameter could be any of the values listed. For example,
:ACQuire:TYPE <type>
:ACQuire:TYPE?
Wherein, <type> can be set to NORMal|AVERages|PEAK|HRESolution.
The query returns the abbreviations (NORM, AVER, PEAK or HRES).
3.Integer
Unless otherwise noted, the parameter can be any integer within the effec tive value range. Note that
do not set the parameter to a decimal, otherwise errors will occur.
For example,
:DISPlay:GBRightne ss <br i ghtne ss >
:DISPlay:GBRightness?
Wherein, <brightness> can be set to any integer between 0 and 100.
The query returns an integer between 0 and 100.
1-2 MSO2000A/DS2000A Programming Guide
1 SCPI Overview RIGOL
1-3
4.Real
The parameter can be any real number within the effective value range and this command accepts
decimal and scientific notation parameter input. For example,
:FUNCtion:WREPlay:INTerval <interval>
:FUNCtion:WREPlay:INTerval?
Wherein, <interval> can be set to any real number between 0.0000001 (or 1e-07, namely 100ns) to
10 (or 1e+01, namely 10s).
The query returns a real number in scientific notation.
5.ASCII String
The parameter should be the combinations of ASCII characters. For example,
:CALCulate:ADVanced:EXPRession <expression>
:CALCulate:ADVanced:EXPRession?
Wherein, <expression> can be set to CH1+CH2
The query returns a n ASCII string.
Command Abbreviation
All the co mmands are case-insensitive and you can use any of them. If abbreviation is used, all the capital
English letters and numbers in the command must be written completely. For example,
:CALCulate:ADVanced:VARiable1?
can be abbreviated to
:CALC:ADV:VAR1?
MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2 Command System
This chapter introduces the command subsystems of MSO2000A/DS2000A command set.
1. Unless otherwise noted, the introductions and parameter ranges in this manual are based on
MSO2302A-S.
2. For parameter set ting c ommands (such as time, frequenc y and amplitud e), the oscilloscope can only
accept numbers and set the parameters using the default units ; it cannot recognize the units sent
with the parameters. For the default unit of each parameter, please refer to the description in each
command in the following introductions.
MSO2000A/DS2000A Programming Guide 2-1
RIGOL2 Command System
:AUToscale
Syntax
:AUToscale
Description
Enable the waveform auto setting function. The oscilloscope adjusts the vertical scale, horizontal time
base and trigger mode according to the input signal automatically to realize optimum waveform display.
The function of this command is the same with that of AUTO on the front panel.
Explanation
This command is invalid when the AUTO function is disabled. For the details, please refer
to
:SYSTem:AUToscale.
When the current status of the pass/fail function is "Enable Test", this command is not available. For
the details, please refer to
:MASK:ENABle.
:CLEar
Syntax
:CLEar
Description
Clear all the waveforms on the screen. New waveforms will still be displayed if the oscilloscope is in RUN
state. The function of this command is the same with that of CLEAR on the front panel.
:RUN
:STOP
Syntax
:RUN
:STOP
Description
The :RUN c ommand starts the oscilloscope and the :STOP command stops the oscilloscope. The functions
of these commands are the same with those of RUN/STOP on the front panel.
Explanation
These commands are invalid when waveform recording or waveform playback is turned on.
2-2 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-3
:SINGle
Syntax
:SINGle
Description
Set the oscilloscope to single trigger mode.
Explanation
In single trigger mode, the oscilloscope triggers once the trigger conditions are met and then stops.
In single trigger mode, using the
You can use the
state respectively.
:RUN and :STOP command to set the oscilloscope to Auto trigger mode and STOP
:TFORce command can generate a trigger signal forcefully.
:TFORce
Syntax
:TFORce
Description
Generate a trigger signal forcefully. The function of this command is the same with that of FORCE in the
trigger control area on the front panel.
:TLHAlf
Syntax
:TLHAlf
Description
Set the trigger level to the vertical midpoint of the trigger signal amplitude.
MSO2000A/DS2000A Programming Guide
RIGOL2 Command System
IEEE 488.2 Common Commands
The IEEE 488 .2 standard defines some common commands used for querying the basic i nformation of the
instrument or executing basic operations. These commands usually start with "*" and the keyword of the
command is usually 3-character long.
Clear all the event registers and clear the error queue.
2-4 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-5
*ESE
Syntax
*ESE <mask>
*ESE?
Description
Set or query the enable register for the standard event status register set.
Parameter
Name Type Range Default
<mask> Integer 0 to 255 0
Explanation<mask> is the sum of the binary weights (expressed in decimal) of all the bits between bit 0 and bit
7 that have already been set. If the bit has already been set, the corresponding binary bit is 1;
otherwise, it is 0.
Definit ions of the bits in ESE register:
BitWeightsNameEnable
7 128 PON Power On
6 64 URQ User Request
5 32 CME Command Error
4 16 EXE Execution Error
3 8 DDE Dev. Dependent Error
2 4 QYE Query Error
1 2 RQL Request Contro l
0 1 OPC Operation Complete
Return Format
The query returns an integer between 0 and 255 which equals the sum of the binary weights (expressed
in decimal) of all the bits that have already been set in the register.
For example, the query returns 144 if bit 4 (16 in decimal) and bit 7 (128 in decimal) are enabled.
Return Format
The query returns an integer between 0 and 255 which equals the sum of the binary weights (expressed
in decimal) of all the bits that have already been set in the register. For example, the query returns 144 if
bit 4 (16 in decimal) and bit 7 (128 in decimal) are enabled.
*IDN?
Syntax
*IDN?
Description
Query the current device information.
Return Format
The query returns R IGOL TECHNOLO GI ES ,<model>,<serial number>,<software version>.
Wherein,
<model> is the model number of the instrument. <serial numb er> is th e serial number of the instrument.
<software version> is the softw are version of the instrument.
2-6 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-7
*OPC
Syntax
*OPC
*OPC?
Description
Set the Operation Complete bit (bit 0) in the standard event status register to 1 after the current
operation is finished.
Query whether the current operation is finished.
Return Format
The query returns 1 if the current operation is finished ; otherwise, returns 0.
*RST
Syntax
*RST
Description
Restore the instrument to the factory setting.
MSO2000A/DS2000A Programming Guide
RIGOL2 Command System
*SRE
Syntax
*SRE <mask>
*SRE?
Description
Set or query the enable register for the state byte register set.
Parameter
Name Type Range Default
<mask> Integer 0 to 255 0
Explanation<mask> is the sum of the binary weights (expressed in decimal) of all the bits between bit 0 and bit
7 that have already been set. If the bit has already been set, the corresponding binary bit is 1;
otherwise, it is 0.
Definit ions of the bits of SRE register:
BitWeightsNameEnable
7 128 OPER Operation Status Reg
6 64 -- Not used
5 32 ESB Event Stat us Bit
4 16 MAV Message Available
3 8 -- Not used
2 4 MSG Message
1 2 USR User
0 1 TRG Trigger
Return Format
The query returns an integer between 0 and 255 which equals the sum of the binary weights (expressed
in decimal) of all the bits that have already been set in the register. For example, the query retu rns 144 if
bit 4 (16 in decimal) and bit 7 (128 in decimal) are enabled.
Example
*SRE 16 /*Bit 4 is enabled*/
*SRE? /*The query returns 16*/
2-8 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-9
*STB?
Syntax
*STB?
Description
Query the condition register for the state byte register set.
Explanation
Definit ions of the bits of SRE register:
BitWeightsNameEnable
7 128 OPER Operation Status Reg
6 64 -- Not used
5 32 ESB Event Status Bit
4 16 MAV Message Available
3 8 -- Not used
2 4 MSG Message
1 2 USR User
0 1 TRG Trigger
Return Format
The query returns an integer between 0 and 255 which equals the sum of the binary weights (expressed
in decimal) of all the bits that have already been set in the register. For example, the query retu rns 144 if
bit 4 (16 in decimal) and bit 7 (128 in decimal) are enabled.
Example
*STB? /*The query returns 24 (bit 3 and bit 4 are enabled)*/
MSO2000A/DS2000A Programming Guide
RIGOL2 Command System
*TST?
Syntax
*TST?
Description
Perform a self-test and query the result .
Explanation
The self-test result is denoted by a 32-bit binary number. If the corresponding binary bit is 0, the self-test
item passes the test; while 1 indicates a failure. The return value is the decimal integer corresponding t o
the binary number.
The self-test item represented by each bit is as shown below. The bit that is not used is always 0.
bit0: system voltage
bit1: analog voltage
bit2: storage system
bit3: digital core
bit4: digital IO
bit9: fan 1
bit10: fan 2
bit12: inlet temperature
bit13: outlet temperature
bit16: real-time clock
Return Format
The query returns a decimal integer.
Example
*TST? /*The query returns 0 (namely the 32 bits of the binary number are all 0*/
Description
Set or query the number of averages in average acquisition mode.
Parameter
Name Type Range Default
<count> Discrete 2n (n is an integer from 1 to 13) 2
Explanation
You can use the
oscilloscope averages the waveforms from multiple samples to reduce the random noise on the input
signal and improve the vertical resolution. Greater number of averages can lower the noise and increase
the vertical resolution; while at the same time, it will slower the response of the displayed wavefor m t o
the waveform changes.
Return Format
The query returns the number of averages in average acquisition mode in integer.
:ACQuire:TYPE command to select the average acquisition mode. In this mode, the
MSO2000A/DS2000A Programming Guide
RIGOL2 Command System
:ACQuire:MDEPth
Syntax
:ACQuire:MDEPth <mdep>
:ACQuire:MDEPth?
Description
Set or query the memory depth of the oscilloscope; namely the number of waveform points that can be
stored in a single trigger sample. The default unit is pts (points).
Parameter
Name Type Range Default
<mdep> Discrete Refer to Explanation AUTO
The query returns the memory depth of the oscilloscope in integer.
:ACQuire:SRATe?
Syntax
:ACQuire:SRATe?
Description
Query the current sample rate. The default unit is Sa/s.
Return Format
The query returns the current sample rate in scientific notation. For example, 1.00000e+09; name ly
1.000GSa/s.
2-12 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-13
:ACQuire:TYPE
Syntax
:ACQuire:TYPE <type>
:ACQuire:TYPE?
Description
Set or query the acquisition mode of the sample.
Parameter
Name Type Range Default
<type> Discrete {NORMal|AVERages|PEAK|HRESolution} NORMal
ExplanationNORMal: the oscilloscope samples the signal at equal time interval. For most of waveforms, this
mode can ensure the optimum display effect.
AVERages: the oscilloscope averages the waveforms from multiple samples to reduce the random
noise on the input signal and increase the vertical resolution. In this mode, you can use
the
:ACQuire:AVERages command to set the number of averages.
PEAK: the oscilloscope samples the maximum and minimum values of the signal within the sample
interval to acquire the envelop of the signal and narrow pulses that might be lost. But in this mode,
the display noise is relatively larger.
HRESolution: the oscilloscope averages the neighbouring points of the sampled waveform. This
mode is usually used when the sample r ate of the digital con verter is greater th an the storage r ate of
the sample storage.
Return Format
The query returns NORM, AVER, PEAK, or HRES.
MSO2000A/DS2000A Programming Guide
RIGOL2 Command System
:ACQuire:AALias
Syntax
:ACQuire:AALias <bool>
:ACQuire:AALias?
Description
Enable or disable the antialiasing function of the oscilloscope; or query the current state of the
antialiasing function of the oscilloscope.
Parameter
Name Type Range Default
<bool> Bool {{1|ON}|{0|OFF}} 0|OFF
Return Format
The query returns 1 or 0.
2-14 MSO2000A/DS2000A Programming Guide
Loading...
+ 380 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.