RIGOL is a registered trademark of RIGOL Technologies, Inc.
Publication Number
PGA17103-1110
Notices
RIGOL products are protected by patent law in and outside of P.R.C.
RIGOL reserves the right to modify or change parts of or all the specifications and pricing policies at
company’s sole decision.
Information in this publication replaces all previously corresponding material.
RIGOL shall not be liable for losses caused by either incidental or consequential 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 or photocopied or rearranged without prior written
approval of RIGOL.
Product Certification
RIGOL guarantees this product conforms to the national and industrial standards in China as well as the
ISO9001:2008 standard and the ISO14001:2004 standard. Other international standard conformance
certification is in progress.
Contact Us
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
DS1000Z Programming Guide I
RIGOL
Tip
For the newest version of this manual, please download it from www.rigol.com.
Model
Analog Bandwidth
Channel Number
Source Channel Number
DS1104Z
100 MHz
4
None
DS1074Z
70 MHz
4
None
DS1104Z-S
100 MHz
4 2 DS1074Z-S
70 MHz
4
2
Document Overview
This manual guides users to control RIGOL DS1000Z series digital oscilloscope remotely by programming
using SCPI commands through the remote interface. DS1000Z can build communication with PC through
USB, LAN or GPIB (option).
Main Topics in this Manual:
Chapter 1 Programming Overview
This chapter introduces how to build the remote communication between DS1000Z series digital
oscilloscope and PC, remote control method as well as brief introduction of the SCPI commands.
Chapter 2 Command System
This chapter introduces the syntax, function, parameter and using instruction of each command.
Chapter 3 Programming Demos
This chapter lists some programming demos to illustrate how to use commands to realize the common
functions of the oscilloscope in the development environments of Excel, LabVIEW, Matlab, Visual Basic 6.0
and Visual C++ 6.0.
Format Conventions in this Manual:
1. Button
The function key at the front panel is denoted by the format of “Button Name (Bold) + Text Box” in the
manual, for example, Utility denotes the “Utility” key.
2. Menu
The menu item is denoted by the format of “Menu Word (Bold) + Character Shading” in the manual,
for example, System denotes the “System” item under Utility.
3. Operation Step
The next step of the operation is denoted by an arrow “” in the manual. For example, Utility
System denotes pressing Utility at the front panel and then pressing System.
Content Conventions in this Manual:
DS1000Z series include the following models. Unless otherwise noted, this manual takes DS1104Z-S as an
example to illustrate the command system of DS1000Z series.
II DS1000Z Programming Guide
Contents RIGOL
Contents
Guaranty and Declaration ......................................................................................................... I
Document Overview ................................................................................................................. II
Visual C++ Programming Demo ............................................................................................. 3-15
VI DS1000Z Programming Guide
Chapter 1 Programming Overview RIGOL
Chapter 1 Programming Overview
This chapter introduces how to build the remote communication between the PC and instrument and
provides an overview of the syntax, symbol, parameter type and abbreviation rules of the SCPI commands.
Main topics of this chapter:
To Build Remote Communication
Remote Control Methods
SCPI Command Overview
DS1000Z Programming Guide1-1
RIGOL Chapter 1 Programming Overview
1
2 3 4
To Build Remote Communication
This oscilloscope can build communication with PC through USB, LAN or GPIB (option) interface. This
section will introduces detailly how to control the oscilloscope remotely through USB interface using Ultra
Sigma.
Operation Steps:
1. Install the Ultra Sigma common PC software
Download the Ultra Sigma common PC software from
CD supplied with the accessories and install it according to the instructions.
2. Connect the instrument and PC and configure the interface parameters of the instrum ent
DS1000Z can build communication with PC through USB, LAN or G PIB (option) interface. This manual
takes USB as an example.
(1) Connect the devices
Connect the USB DEVICE interface at the real panel of the oscilloscope and the USB Host interface
of the PC using USB cable.
(2) Install the USB driver
This oscilloscope is a USBTMC device. Assuming that your PC has already been installed with
Ultra Sigma, after y ou connect the oscilloscope to the PC and turn both on for the first time (the
oscilloscope is automatically configured to USB interface), the New Hardware Wizard as shown
in the figure below is displayed on the PC. Please install the “USB Test and Measurement Device”
driver following the directions in the wizard. The steps are as follows.
www.rigol.com or acquire it from the resource
1-2 DS1000Z Programming Guide
Chapter 1 Programming Overview RIGOL
5 6 7
(3) Search device resource
Start up the Ultra Sigma and the software will automatically search for the oscilloscope
resources currently connected to the PC. You can also click
During the search, the status bar of the software is as shown in the figure below.
to search the resources.
DS1000Z Programming Guide 1-3
RIGOL Chapter 1 Programming Overview
(4) View the device resource
The resources found will appear under the “RIGOL Online Resource” directory and the model
number and USB interface information of the instrument will also be displayed as shown in the
figure below.
(5) Communication test
Right click the resource name “DS1104Z (USB0::0x1AB1::0x04CE::DS1T0000000006::INSTR)” to
select “SCPI Panel Control” to turn on the remote command control panel (as shown in the figure
below) through which you can send commands and read data.
Remote Control Methods
1. User-defined Programming
Users can use SCPI (Standard Commands for Programmable I nstruments) command s to pr ogr am and
control the oscilloscope. For details, refer to the introductions in Chapter 3
2. Send SCPI Commands via the PC Software
You can control the oscilloscope remotely by sending SCPI commands via the PC software (Ultra Sigma)
provided by RIGOL
Automation Explorer” of NI (National Instruments Corporation) or the “Agilent IO Libraries Suite” of
Agilent (Agilent Technologies, Inc.).
1-4 DS1000Z Programming Guide
. Besides, you can also control the instrument using the “Measurement &
Programming Demos.
Chapter 1 Programming Overview RIGOL
SCPI Command Overview
SCPI (Standard Commands for Programmable Instruments) is a standardized instrument programming
language that is built upon the standard IEEE488.1 and IEEE 488.2 and conforms to various standards
(such as the floating point operation rule in IEEE754 standard, ISO646 7-bit coded character for
information interchange (equivalent to ASCll programming)). This section introduces the syntax, symbols,
parameters and abbreviation rules of the SCPI commands.
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; the
command and param e t e r are separated by "space".
For example,
:ACQuire:TYPE <type>
:ACQuire:TYPE?
ACQuire is the root keyword of the command. TYPE is the second-level keyword. The command string starts
with ":" which separates the multiple-level keywords. <type> represents the parameters available for
setting. "?" represents query . The command :ACQuire:TYPE and parameter <type> are separated by space.
"," is generally used for separating multiple parameters contained in the same command, for example,
:TRIGger:PATTern:PATTern <pattern1>,<pattern2>,<pattern3>,<pattern4>
Symbol Description
The following symbols will not be sent with the commands.
1.Braces {}
The parameters enclosed in the braces are optional and are usually separated by the vertic al bar "|".
When using the command, one of the parameters must be selected.
2.Vertical Bar |
The vertical bar is used to separate multiple parameters and one of the parameters must be selected
when using 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.
DS1000Z Programming Guide 1-5
RIGOL Chapter 1 Programming Overview
Parameter Type
1. Bool
The parameter could be OFF, ON, 0 or 1. For example,
:MEASure:ADISplay <bool>
:MEASure:ADISplay?
Wherein,
<bool> can be set to {{0|OFF}|{1|ON}}.
The query returns 0 or 1.
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 (NR1 format) within the effective value
range. Note that 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 any integer between 0 and 100.
The query returns an integer between 0 and 100.
4. Real
The parameter can be any real number within the effective value range and this command accepts
decimal (NR2 format) and scientific notation (NR3 format) parameter input. For example,
:TRIGger:TIMeout:TIMe <NR3>
:TRIGger:TIMeout:TIMe?
Wherein,
<NR3> can be set to any r eal number between 1.600000e-08 (namely 16ns) to 0.1e+02 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,
:SYSTem:OPTion:INSTall <license>
Wherein,
<license> can be set to PDUY9N9QTS9PQSWPLAETRD3UJHYA.
Command Abbreviation
All the commands are case-insensitive and you can use any of them. If abbreviation is used, all the capital
letters in the command must be written completely. For example, the :MEASure:ADISplay? command can
be abbreviated to :MEAS:ADIS?.
1-6 DS1000Z Programming Guide
Chapter 2 Command System RIGOL
Chapter 2 Command System
This chapter introduces the syntax, function, parameter and using instruction of each DS1000Z command.
1. Unless otherwise noted, this manual takes DS1104Z-S as an example to introduces the commands.
2. For parameter setting commands (for example, time , frequency, amplitude and etc.), the oscilloscope
can only accept numbers and set the parameters using default units and can not recognize the units
following the parameters. For the default units of each parameter, please refer to the description in
each command listed following.
DS1000Z Programming Guide2-1
RIGOL Chapter 2 Command System
Syntax
:AUToscale
the front panel.
waveform, this command is invalid.
Syntax
:CLEar
still be displayed. This command is equivalent to press the CLEAR key at the front panel.
Command
:STOP
waveform, this command is invalid.
:AUToscale
Description Enable the waveform auto setting function. The oscilloscope will automatically adjust the
vertical scale, horizontal timebase and trigger mode according to the input signal to
realize optimum waveform display. This command is equivalent to press the AUTO key at
Explanation Theoretically, wavef orm auto setting f unction requires that the frequ ency of sine can
not be lower than 41Hz, the duty cycle should be greater than 1% as well as the
amplitude must be greater than 20mVpp for square.
When the pass/fail function is enabled (see the
this command, the oscilloscope will disable the pass/fail function firstly and the
execute waveform auto setting function.
When the waveform record function is enabled or during playback the recorded
:MASK:ENABle command), if y ou sent
:CLEar
Description Clear all the waveforms on the screen. If the oscilloscope is in RUN state, wavef orm will
Related
:DISPlay:CLEar
:RUN
:STOP
Syntax :RUN
Description The :RUN command makes the oscilloscope starting running and the :STOP command
makes the oscilloscope stopping running. These commands are equivalent to press the
RUN/STOP key at the front panel.
Explanation When the waveform record function is enabled or during playback the recorded
2-2 DS1000Z Programming Guide
Chapter 2 Command System RIGOL
Syntax
:SINGle
the :TRIGger:SWEep SINGle command.
waveform, this command is invalid.
:STOP
Syntax
:TFORce
key at the front panel.
Command
:SINGle
Description Set the oscilloscope to single trigger mode. This command is equivalent to the following
two operations: pressing the SINGLE key at the front panel, sending
Explanation In single trigger mode, the oscilloscope triggers once the trigger conditions are met
and then stops.
When the waveform record function is enabled or during playback the recorded
Related
Command
:TFORce
:RUN
:TFORce
Description Generate a trigger signal forcefully. This command is only applicable to normal and single
Related
trigger mode (see the
:TRIGger:SWEep
:TRIGger:SWEep command) and is equivalent to press the FORCE
DS1000Z Programming Guide 2-3
RIGOL Chapter 2 Command System
:ACQuire:AVERages?
Description
Set or query the number of averages under average acquisition mode.
Name
Type
Range
Default
<count>
Integer
2n (n is an integer and ranges from 1 to 10)
2
response of the displayed waveform to the waveform changes will be.
Format
:ACQuire:AVERages? /*The query returns 128*/
:ACQuire Commands
:ACQuire commands are used to set or query the memory depth, acquisition mode and the current sample
rate of the oscilloscope as well as to set the number of averages under average acquisition mode.
: In the “Command List” in this manual, the parameters in the setting commands and the query
commands are not included and you can refer to the complete introductions of the commands in the text
according to the keyword.
:ACQuire:AVERages
Syntax :ACQuire:AVERages <count>
[1]
:
Parameter
Explanation You can sent the :ACQuire:TYPE command to set the acquisition mode.
In average acquisition mode, the greater the number of av erages is, the lower the
noise will be and the higher the vertical resolution will be but the slower the
Return
Example
Related
Command
The query returns an integer between 2 and 1024.
:ACQuire:AVERages 128 /*Set the number of averages to 128*/
:ACQuire:TYPE
2-4 DS1000Z Programming Guide
Chapter 2 Command System RIGOL
:ACQuire:MDEPth?
points that can be stored in a single trigger sample. The default unit is pts (points).
Name
Type
Range
Default
according to the current sample rate.
Format
:ACQuire:MDEPth? /*The query returns 12000*/
:TIMebase[:MAIN]:SCALe
:ACQuire:MDEPth
Syntax :ACQuire:MDEPth <mdep>
Description Set or query the memory depth of the oscilloscope namely the number of waveform
Parameter
<mdep>
Discrete Refer to the Explanation
AUTO
Explanation When a single channel is on: {AUTO|12000|120000|1200000|12000000|24000000}
When dual channels are on: {AUTO|6000|60000|600000|6000000|12000000}
When four channels are on: {AUTO|3000|30000|300000|3000000|6000000}
Wherein, 24000000, 12000000 and 6000000 are optional.
The relationship among the memory depth, sample rate and waveform length is
satisfied with the following equation:
Memory Depth = Sample Rate × Waveform Length
Wherein, the Memory Depth can be set using the
:ACQuire:MDEPth command and
the Waveform Length is the product of the horizontal timebase (set by
:TIMebase[:MAIN]:SCALe command) and the number of the horizontal scales
the
(12 for DS1000Z).
When AUTO is selected, the oscilloscope will select the memory depth automatically
Return
Example
Related
The query returns the actual number of points (integer) or AUTO.
:ACQuire:MDEPth 12000 /*Set the memory depth to 12000*/
:ACQuire:SRATe?
Command
DS1000Z Programming Guide 2-5
RIGOL Chapter 2 Command System
:ACQuire:TYPE?
Description
Set or query the acquisition mode when the oscilloscope samples.
Name
Type
Range
Default
<type>
Discrete
{NORMal|AVERages|PEAK|HRESolution}
NORMal
storage rate of the acquisition memory.
Format
Example
:ACQuire:TYPE AVERages /*Select the average a c quisition mode*/
Command
:ACQuire:TYPE
Syntax :ACQuire:TYPE <type>
Parameter
Explanation
Return
NORMal
: in this mode, the oscilloscope samples the signal at equal time interval to
rebuild the waveform. For most of the waveforms, the best display effect can be
obtained using this mode.
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. The number of averages can be set by senting the
command.
The gr eater the number of av erages is, the lower the n oise will be and the
:ACQuire:AVERages
higher the vertical resolution will be but the slower the response of the displayed
waveform to the waveform changes will be.
PEAK (Peak Detect): in this mode, the oscilloscope acquires the maximum and
minimum values of the signal within the sample interval to get the envelope of the
signal or the narrow pulse of the signal that might be lost. In this mode, signal
confusion can be prevented but the noise displayed would be larger.
HRESolution (High Resolution): this mode uses a kind of ultra-sample technique to
average the neighboring points of the sample waveform to reduce the r andom noise
on the input signal and generate much smoother waveforms on the screen. This is
generally used when the sample rate of the digital converter is higher than the
The query returns NORM, AVER, PEAK or HRES.
Related
:ACQuire:AVERages
2-6 DS1000Z Programming Guide
Chapter 2 Command System RIGOL
:ACQuire:SRATe?
Query the current sample rate. The default unit is Sa/s.
The oscilloscope starts to execute self-calibration.
sent the :CALibrate:QUIT command to quit the self-calibration.
Command
:ACQuire:SRATe?
Syntax
Description
Explanation Sample rate is the sample frequency of the oscilloscope, namely the waveform points
sampled per second.
The relationship among the memory depth, sample rate and waveform length is
satisfied with the following equation:
Memory Depth = Sample Rate × Waveform Length
Wherein, the Memory Depth can be set using the
the Waveform Length is the product of the horizontal timebase (set by
:TIMebase[:MAIN]:SCALe command) and the number of the horizontal scales
the
:ACQuire:MDEPth command and
Return
Related
Command
The query returns the sample rate in scientific notation.
:ACQuire:MDEPth
:TIMebase[:MAIN]:SCALe
:CALibrate Commands
Command List:
:CALibrate:QUIT
:CALibrate:STARt
:CALibrate:QUIT
Related
:CALibrate:STARt
:CALibrate:STARt
Explanation The self-calibration can make the oscilloscope quickly reach its optimum working
state to obtain the most accurate measurement values.
During the self-calibration, all the channels of the oscilloscope must be disconnected
from the inputs.
The functions of most of the keys are disabled during the self-calibration. You can
Related
DS1000Z Programming Guide 2-7
:CALibrate:QUIT
RIGOL Chapter 2 Command System
:CHANnel<n>:BWLimit?
Description
Set or query the bandwidth limit parameter of the specified channel.
Name
Type
Range
Default
<n>
Discrete
{1|2|3|4}
<type>
Discrete
{20M|OFF}
OFF
frequency components.
Format
Example
:CHANnel1:BWLimit 20M /*Enable the 20MHz bandwidth limit*/
:CHANnel<n> Commands
:CHANnel<n> commands are used to set or query the vertical system parameters, such as bandwidth limit,
coupling, vertical scale and vertical offset.
Description Set or query the delay calibration time of the specified channel to calibrate the zero of fset
Parameter
<n> Discrete {1|2|3|4}
——
Explanation The <val> parameter can only be set to specific values in specified step. If the parameter
you sent is not one of the values that can be set, the parameter will be set automatically
to the nearest value. The step varies with the horizontal timebase (set by
:TIMebase[:MAIN]:SCALe command).
the
Return
The query returns the delay calibration time in scientific notation.
Example
Related
:CHANnel1:TCAL 0.00002 /*Set the delay calibration time to 20ns*/
:TIMebase[:MAIN]:SCALe
DS1000Z Programming Guide 2-11
RIGOL Chapter 2 Command System
:CHANnel<n>:SCALe?
Description
Set or query the vertical scale of the specified channel. The default unit is V.
Name
Type
Range
Default
used to improve the amplitude of waveform display to view signal d etails.
<n> Discrete {1|2|3|4}
<scale> Real Be dependent on the current probe ratio.
probe ratio = 1: 1mV to 10V
——
1V (the probe
ratio is 10)
probe ratio = 10 (default): 10mV to 100V
Explanation The range of the vertical scale is dependent on the current probr ratio (set by
:CHANnel<n>:PROBe command). Because the default probe ratio of DS1000Z is
the
10, the default value of <scale> is the value when the probe ratio is 10.
You can use the
:CHANnel<n>:VERNier command to enable or disable the fine
adjustment of the vertical scale. By default, the fine adjustment is off. At this point,
you can only set the vertical scale in 1-2-5 step, namely 1mV, 2mV, 5mV, 10mV, …,
10V. When the fine adjustment is on, you can further adjust the vertical scale within
a relatively smaller range to improve vertical resolution. If the amplitude of the input
waveform is a little bit greater than the full scale under the current scale and the
amplitude would be a little bit lower if the next scale is used, fine adjustment can be
Return
Example
Related
The query returns the vertical scale in scientific notation.
:CHANnel1:SCALe 1 /*Set the vertical scale of CH1 to 1V*/
Explanation By default, the fine adjustment is off. At this point, you can only set the vertical scale in
1-2-5 step, namely 1mV, 2mV, 5mV, 10mV…10V. When the fine adjustment is on, you can
further adjust the vertical scale within a relatively smaller range to improve vertical
resolution. If the amplitude of the input waveform is a little bit greater than the full scale
under the current scale and the amplitude would be a little bit lower if the next scale is
used, fine adjustment can be used to improve the amplitude of waveform display to view
——
Return
Related
The query returns 0 or 1.
:CHANnel<n>:SCALe
DS1000Z Programming Guide 2-13
RIGOL Chapter 2 Command System
:CURSor:MODE?
Description
Set or query the cursor measurement mode.
Name
Type
Range
Default
<mode>
Discrete
{OFF|MANual|TRACk|AUTO|XY}
OFF
horizontal timebase mode is XY.
Format
Example
:CURSor:MODE MANual /*enable the manual cursor mode*/
:CURSor Commands
:CURSor comm ands are used to me asure the X -axis v alue (such as time) and Y-axis value (such as voltage)
of the waveform displayed in the screen.
Explanation OFF: disable the cursor measurement function.
MANual: enable the manual cursor measurement mode.
TRACk: enable the track cursor measurement mode.
AUTO: enable the auto cursor measurement mode.
XY: enable the XY cursor measurement mode. This mode is valid only when the