RIGOL is a registered trademark of RIGOL (SUZHOU) TECHNOLOGIES INC.
Publication Number
PGA25100-1110
Software Version
00.00.00.SP1
Software upgrade might change or add product features. Please acquire the latest version of the manual
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 reserves the right to modify or change 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 consequential losses in connection with the furnishing,
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 conformance
certifications are in progress.
ContactUs
If you have any problem or requirement when using our products or this manual, please contact RIGOL.
E-mail: service@rigol.com
Website: www.rigol.com
MSO5000 Programming Guide I
RIGOL
Model
Analog
Bandwidth
No. of
Analog
Channels
No. of Function/Arbitrary
Waveform Generator
Channels
No. of Digital
Channels
MSO5072
70 MHz
2
2, Opt.
16
MSO5074
70 MHz
4
2, Opt.
16
MSO5102
100 MHz
2
2, Opt.
16
MSO5104
100 MHz
4
2, Opt.
16
MSO5204
200 MHz
4
2, Opt.
16
MSO5354
350 MHz
4
2, Opt.
16
Tip
For the latest version of this manual, download it from the official website of RIGOL (www.rigol.com).
Document Overview
This manual is your guide to programming RIGOL MSO5000 series digital oscilloscope. MSO5000 series
can communicate with the PC via the USB, LAN, or GPIB (requiring to work with RIGOL's USB-GPIB
interface converter) interface.
Main Topics in this Manual:
Chapter 1 SCPI Command Overview
This chapter introduces the syntax, symbols, parameters, and abbreviation rules of the SCPI commands.
Chapter 2 Command System
This chapter introduces the syntax, function, parameters, and descriptions of each command.
Chapter 3 Programming Examples
This chapter illustrates how to control the MSO5000 series digital oscilloscope by programming in Excel,
LabVIEW, Visual Basic, and Visual C++.
Format Conventions in this Manual:
1. Key
The key on the front panel is denoted by the format of "Key Name (Bold) + Text Box" in the manual.
For example, Utility denotes the "Utility" key.
2. Menu
The menu items are denoted by the format of "Menu Word (Bold) + Character Shading". For example,
System denotes the "System" menu item under Utility.
3. Operation Procedures:
"" denotes the next step of operation. For example, Utility System denotes that first press
Utility, and then press the System softkey.
Content Conventions in this Manual:
MSO5000 series includes the following models. Unless otherwise specified, this manual takes MSO5354 as
an example to illustrate the functions and operation methods of MSO5000 series.
II MSO5000 Programming Guide
Contents RIGOL
Contents
Guaranty and Declaration ......................................................................................................... I
Document Overview ................................................................................................................. II
LabVIEW Programming Example ................................................................................................ 3-7
Visual Basic Programming Example .......................................................................................... 3-11
Visual C++ Programming Example ........................................................................................... 3-13
MSO5000 Programming GuideIX
Chapter 1 SCPI Command Overview RIGOL
Chapter 1 SCPI Command Overview
SCPI (Standard Commands for Programmable Instruments) is a standardized instrument programming
language that is built upon the existing standard IEEE 488.1 and IEEE 488.2 and conforms to various
standards, such as the floating point operation rule in IEEE 754 standard, ISO 646 7-bit coded character set
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 one root keyword
and one or more sub-keywords.
Contents in this chapter:
Syntax
Symbol Description
Parameter Type
Command Abbreviation
MSO5000 Programming Guide1-1
RIGOLChapter 1 SCPI Command Overview
Syntax
The command line usually starts with a colon; the keywords are separated by colons, and following the
keywords are the parameter settings available. The command ending with a quotation mark indicates
querying a certain function. The keywords of the command and the first parameter is separated by a space.
For example,
:ACQuire:TYPE <type>
:ACQuire:TYPE?
ACQuire is the root keyword of the command, and TYPE is the second-level keyword. The command line
starts with a colon, and different levels of keywords are also separated by colons. <type> indicates a
settable parameter. The command ending with a quotation mark indicates querying a certain function. The
command keywords ":ACQuire:TYPE" and the parameter <type> are separated by a space.
In some commands with parameters, "," is often used to separate multiple parameters. For example,
:SYSTem:DATE <year>,<month>,<day>.
Symbol Description
The following symbols are not sent with the commands.
1.Braces { }
The contents enclosed in the braces are parameter options, Parameters are usually separated by the
vertical bar "|". When using the command, you must select one of the parameters.
2.Vertical Bar |
The vertical bar is used to separate multiple parameters. When using the command, you must select
one of the parameters.
3.Square Brackets [ ]
The contents in the square brackets can be omitted.
4.Angle Brackets < >
The parameter enclosed in the angle brackets must be replaced by an effective value.
Parameter Type
1. Bool
The parameter can be set to ON, OFF, 1, or 0. For example,
:SYSTem:BEEPer <bool>
:SYSTem:BEEPer?
Wherein,
<bool> can be set to {{1|ON}|{0|OFF}}.
The query returns 1 or 0.
2. Discrete
The parameter can be any of the values listed. For example,
:ACQuire:TYPE <type>
:ACQuire:TYPE?
Wherein,
<type> can be set to NORMal, AVERages, or PEAK.
The query returns NORM, AVER, or PEAK.
1-2 MSO5000 Programming Guide
Chapter 1 SCPI Command Overview RIGOL
3. Integer
Unless otherwise specified, the parameter can be any integer (NR1 format) within the effective value
range.
Note: Do not set the parameter to a decimal, otherwise, errors will occur.
For example,
:DISPlay:GBRightness <brightness>
:DISPlay:GBRightness?
Wherein, <brightness> can be set to an integer ranging from 1 to 100.
The query returns an integer ranging from 1 to 100.
4. Real
The parameter can be any real number within the effective value range, and this command accepts
parameter input in decimal (NR2 format) and scientific notation (NR3 format). For example,
:TRIGger:TIMeout:TIME <time>
:TRIGger:TIMeout:TIME?
Wherein, <time> can be set to any real number ranging from 1.6E-8 (i.g. 16 ns) to 1E+1 (i.g. 10 s).
The query returns a real number in scientific notation.
5. ASCII String
The parameter can be the combinations of ASCII characters.
For example,
:SYSTem:OPTion:INSTall <license>
Wherein, <license> can be set to
MSO5000-PWR@3AEBC07E6C31F82B78A1C401DC2E3AC2CC9431B57F60D1E1CB712F8682C93609A6
05F8577BFDE920373062BE226289A27C134E2C91BF80CB00F8011AC181FD40.
Command Abbreviation
All the commands are case-insensitive. They can all be in upper case or in lower case. If abbreviation is
used, you must input all the capital letters in the command. For example,
:DISPlay:GBRightness?
can be abbreviated as
:DISP:GBR?
MSO5000 Programming Guide1-3
Chapter 2 Command System RIGOL
Chapter 2 Command System
This chapter introduces the syntax, functions, parameters, and usage of each MSO5000 command.
Enables the waveform auto setting function. The oscilloscope will automatically adjust the
vertical scale, horizontal time base, and trigger mode according to the input signal to
realize optimal waveform display. This command functions the same as the AUTO key on
the front panel.
Remarks
When the AUTO function is disabled, this command is invalid. For details, refer
to :SYSTem:AUTOscale.
When the pass/fail test is enabled, the AUTO function runs normally, but the pass/fail
test function is forced to be disabled.
When the waveform recording function is enabled or the recorded waveforms are
played back, the AUTO function runs normally, but the recording or playing function is
forced to be disabled.
Syntax
:CLEar
Description
Clears all the waveforms on the screen. This command functions the same as the CLEAR
key on the front panel.
Syntax
:RUN
:STOP
Description
The :RUN command starts the oscilloscope and the :STOP command stops the
oscilloscope. This command functions the same as the RUN/STOP key on the front
panel.
Remarks
When the waveform recording function is enabled, the RUN/STOP key on the front panel
is disabled.
Note:
1. Unless otherwise specified, the descriptions in this manual all take MSO5354 as an example.
2. For the parameter setting command (time, frequency, amplitude, etc.), the digital oscilloscope can only
recognize the numbers, unable to recognize the unit sent together with them. The unit of the
parameter is a default one. For the default units of various parameters, refer to the descriptions for the
specified command.
:AUTOscale
:CLEar
:RUN
:STOP
2-2 MSO5000 Programming Guide
Chapter 2 Command System RIGOL
Syntax
:SINGle
Description
Sets the trigger mode of the oscilloscope to "Single". This command functions the same as
either of the following two operation: press SINGLE on the front panel; or send
the :TRIGger:SWEep SINGle command.
Remarks
In the single trigger mode, the oscilloscope performs a single trigger when the trigger
conditions are met and then it stops.
When the waveform recording function is enabled or the recorded waveforms are
played back, this command is invalid.
For the single trigger, you can use the :TFORce command to generate one trigger by
force.
Syntax
:TFORce
Description
Generates a trigger signal forcefully. This command is only applicable to the normal and
single trigger modes (refer to the :TRIGger:SWEep command). This command functions
the same as the FORCE key in the trigger control area of the front panel.
:SINGle
:TFORce
MSO5000 Programming Guide2-3
RIGOLChapter 2 Command System
Syntax
:ACQuire:AVERages <count>
:ACQuire:AVERages?
Description
Sets or queries the number of averages in the average acquisition mode.
Parameter
Name
Type
Range
Default
<count>
Integer
2n (n is an integer, and its range is from 1 to 16)
2
Remarks
You can send the :ACQuire:TYPE command to set the acquisition mode.
In the average acquisition mode, greater number of averages can lower the noise
and increase the vertical resolution; but will also slow the response of the displayed
waveform to the waveform changes.
Return
Format
The query returns an integer ranging from 2 to 65536.
Example
:ACQuire:AVERages 128 /*Sets the average times to 128.*/
:ACQuire:AVERages? /*The query returns 128.*/
Syntax
:ACQuire:MDEPth <mdep>
:ACQuire:MDEPth?
Description
Sets or queries the memory depth of the oscilloscope (i.g. the number of waveform
points that can be stored through the sampling in a single trigger). The default unit is pts.
Parameter
Name
Type
Range
Default
<mdep>
Discrete
{AUTO|1k|10k|100k|1M|10M|25M|50M|100M|
200M}
AUTO
Remarks
When "AUTO" is selected, the oscilloscope selects the memory depth automatically
according to the current sample rate.
:ACQuire Commands
The :ACQuire commands are used to set the memory depth of the oscilloscope, the acquisition mode, the
average times, as well as query the current sample rate.
omitted. You can refer to the complete introductions of the commands in the body of the text based on the keywords
listed here.
: In the "Command List" in this manual, the query commands and the parameters in the setting commands are
:ACQuire:AVERages
[1]
:
:ACQuire:MDEPth
2-4 MSO5000 Programming Guide
Chapter 2 Command System RIGOL
The maximum memory depth for the single channel is 200 M; the maximum memory
depth for the half-channel is 100 M; and the maximum memory depth for the
all-channel is 50 M.
Return
Format
The query returns AUTO, 1k, 10k, 100k, 1M, 10M, 25M, 50M, 100M or 200M.
Example
:ACQuire:MDEPth 1M /*Sets the memory depth to 1M.*/
:ACQuire:MDEPth? /*The query returns 1M.*/
Syntax
:ACQuire:TYPE <type>
:ACQuire:TYPE?
Description
Sets or queries the acquisition mode of the oscilloscope.
Parameter
Name
Type
Range
Default
<type>
Discrete
{NORMal|AVERages|PEAK|}
NORMal
Remarks
NORMal: In this mode, the oscilloscope samples the signal at a specified fixed time
interval to rebuild the waveform. For most of the waveforms, using this mode can
produce the optimal display effects.
AVERages: In this mode, the oscilloscope averages the waveforms from multiple
samples to reduce the random noise of 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 slow the response of the displayed
waveform to the waveform changes.
PEAK: indicates the peak detection. In this mode, the oscilloscope samples the
maximum and minimum value of the signal at the fixed sampling interval to acquire
the signal envelope or the narrow pulses that might be lost. In this mode, signal
aliasing can be prevented, but the noise displayed would be larger.
Return
Format
The query returns NORM, AVER, or PEAK.
Example
:ACQuire:TYPE AVERages /*Sets the acquisition mode to AVERages.*/
:ACQuire:TYPE? /*The query returns AVER.*/
Syntax
:ACQuire:SRATe?
Description
Queries the current sample rate. The default unit is Sa/s.
Remarks
Sample rate indicates the frequency of the signal sampling, i.g. the number of
waveform points sampled per second.
The formula below describes the relationship among sample rate, memory depth, and
waveform length:
memory depth = sample rate x waveform length
Wherein, the memory depth is set by the :ACQuire:MDEPth command. The waveform
length is obtained by multiplying the horizontal time base (set by
the :TIMebase[:MAIN]:SCALe command) by the number of grids in the horizontal
direction. For MSO5000, the number of grids in the horizontal direction is 10.
Return
The query returns the sample rate in scientific notation.
Enables or disables the specified decoding bus; or queries the on/off display status of
the specified decoding bus.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<bool>
Bool
{{1|ON}|{0|OFF}}
0|OFF
Return
Format
The query returns 1 or 0.
Example
:BUS1:DISPlay ON /*Enables the decoding bus.*/
:BUS1:DISPlay? /*The query returns 1.*/
Syntax
:BUS<n>:FORMat <fmt>
:BUS<n>:FORMat?
Description
Sets or queries the display format of decoding data of the specified decoding bus.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<fmt>
Discrete
{HEX|ASCii|DEC|BIN}
ASCii
Remarks
HEX indicates Hexadecimal; DEC indicates Decimal; BIN indicates Binary.
Return
Format
The query returns HEX, ASC, DEC, or BIN.
Example
:BUS1:FORMat HEX /*Sets the display format of the bus to HEX.*/
:BUS1:FORMat? /*The query returns HEX.*/
Syntax
:BUS<n>:EVENt <bool>
:BUS<n>:EVENt?
Description
Enables or disables the event table of the specified decoding bus; or queries the on/off
status of the specified decoding bus event table.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<bool>
Bool
{{1|ON}|{0|OFF}}
0|OFF
Remarks
Before using the command, enable the specified decoding bus.
Return
Format
The query returns 1 or 0.
Example
:BUS1:EVENt ON /*Enables the event table of the specified decoding bus.*/
:BUS1:EVENt? /*The query returns 1.*/
:BUS<n>:DISPlay
:BUS<n>:FORMat
:BUS<n>:EVENt
2-8 MSO5000 Programming Guide
Chapter 2 Command System RIGOL
Syntax
:BUS<n>:EVENt:FORMat <format>
:BUS<n>:EVENt:FORMat?
Description
Sets or queries the display format of the specified decoding bus event table.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<format>
Discrete
{HEX|ASCii|DEC|BIN}
ASCii
Remarks
HEX indicates Hexadecimal; DEC indicates Decimal; BIN indicates Binary.
Return
Format
The query returns HEX, ASC, DEC, or BIN.
Example
:BUS1:EVENt:FORMat HEX
/*Sets the display format of the specified decoding bus event table to HEX.*/
:BUS1:EVENt:FORMat? /*The query returns HEX.*/
Syntax
:BUS<n>:EVENt:VIEW <packet>
:BUS<n>:EVENt:VIEW?
Description
Sets or queries the data page of the specified decoding bus event table.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<packet>
Discrete
{PACKets|DETails|PAYLoad}
PACKets
Remarks
PACKets: displays time, data, and error information in the specified event table.
DETails: displays the detailed data of the specified row in the event table.
PAYLoad: displays all the data of the specified column in the event table.
When different views are selected, the export format of the data list will be
changed accordingly.
Return
Format
The query returns PACK, DET, or PAYL.
Example
:BUS1:EVENt:VIEW DETails /*Sets the data page of the decoding bus event table
to DETails.*/
:BUS1:EVENt:VIEW? /*The query returns DET.*/
:BUS<n>:EVENt:FORMat
:BUS<n>:EVENt:VIEW
MSO5000 Programming Guide2-9
RIGOLChapter 2 Command System
Syntax
:BUS<n>:LABel <bool>
:BUS<n>:LABel?
Description
Enables or disables the label of the specified decoding bus; or queries the on/off status
of the label of the specified decoding bus.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<bool>
Bool
{{1|ON}|{0|OFF}}
0|OFF
Remarks
Before using the command, enable the specified decoding bus.
Return
Format
The query returns 1 or 0.
Example
:BUS1:LABel ON /*Enables the label of the specified decoding bus.*/
:BUS1:LABel? /*The query returns 1.*/
Syntax
:BUS<n>:DATA?
Description
Reads the data in the decoding event table.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
Return
Format
Returns the data in the decoding event table with the following formats.
#9000000072PAL,
Time,Data,,
-1us,0,,
-990.3ns,1,,
-503.2ns,0,,
9.2ns,1,,
497.2ns,0,
Wherein, "#9000000072" is the TMC data block header, which is followed by the data
in the event table. The 9-digit data following #9 in the data block header indicates
the number of bytes of the effective data. "PAL" indicates the decoding type. The
available decoding type can also be RS232, I2C, SPI, or CAN. The data are separated
by commas, and will automatically go to the next line according to the line length
limit in the decoding list. The data value is related to the numeral system that you
have set.
Note: You can save all the data (except TMC data block header and decoding type,
e.g. #9000000072PAL) as the "*.csv" file and view the data in the form of a
list.
:BUS<n>:LABel
:BUS<n>:DATA?
2-10 MSO5000 Programming Guide
Chapter 2 Command System RIGOL
Syntax
:BUS<n>:EEXPort
Description
Exports the decoding information in the specified decoding bus event table in CSV form.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
Example
:BUS1:EEXPort C:/123.csv
/*Exports the decoding information in the bus event table to the local Disk C,
with the filename 123.csv.*/
Syntax
:BUS<n>:POSition <pos>
:BUS<n>:POSition?
Description
Sets or queries the vertical position of the bus on the screen.
Parameter
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
——
<pos>
Integer
-167 to +217
Related to the
channel offset
Return
Format
The query returns an integer ranging from -167 to +217.
Example
:BUS1:POSition 200 /*Sets the vertical position of the bus to 200.*/
:BUS1:POSition? /*The query returns 200.*/
Syntax
:BUS<n>:THReshold <value>,<type>
:BUS<n>:THReshold? <type>
Description
Sets or queries the threshold of the specified decoding source.
For VerticalScale, refer to the :CHANnel<n>:SCALe command. For OFFSet, refer to
the :CHANnel<n>:OFFSet command.
For RS232 decoding, only when the Rx source is enabled, can you set the threshold.
For SPI decoding, only when the MOSI source is enabled, can you set the threshold.
Return
Format
The query returns the threshold of the specified decoding source in scientific notation.
Example
:BUS1:THReshold 2.4,PAL /*Sets the threshold of the PAL decoding source to 2.4 V.*/
:BUS1:THReshold? PAL /*The query returns 2.400000E0.*/
:BUS<n>:EEXPort
:BUS<n>:POSition
:BUS<n>:THReshold
MSO5000 Programming Guide2-11
RIGOLChapter 2 Command System
Syntax
:BUS<n>:PARallel:CLK <source>
:BUS<n>:PARallel:CLK?
Description
Sets or queries the clock source of the Parallel decoding.