RIGOL RIGOL DS2102A Programming Guide

RIGOL
Programming Guide
MSO2000A/DS2000A Series
Digital Oscilloscope
May 2019
RIGOL (SUZHOU) TECHNOLOGIES INC.

Guaranty and Declaration

Copyright
© 2014 RIGOL (SUZHOU) TECHNOLOGIES INC. All Rights Reserved.
Trademark Information
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.
Model
MSO2102A 100MHz 2 -- 16 MSO2102A-S 100MHz 2 2 16 MSO2202A 200MHz 2 -- 16 MSO2202A-S 200MHz 2 2 16 MSO2302A 300MHz 2 -- 16 MSO2302A-S 300MHz 2 2 16 DS2102A 100MHz 2 -- -­DS2202A 200MHz 2 -- -­DS2302A 300MHz 2 -- --
Analog Bandwidth
Number of Analog Channels
Number of Signal Source Channels
Number of Digital Channels
II MSO2000A/DS2000A Programming Guide
Contents RIGOL
III
Contents
Guaranty and Declaration ......................................................................................................... I
Document Overview ................................................................................................................. II
1 SCPI Overview ..................................................................................................................... 1-1
Syntax ..................................................................................................................................... 1-1
Symbol Description ................................................................................................................... 1-2
Parameter Type ........................................................................................................................ 1-2
Command Abbreviation ............................................................................................................. 1-3
2 Command System ................................................................................................................ 2-1
:AUToscale ............................................................................................................................... 2-2
:CLEar...................................................................................................................................... 2-2
:RUN ........................................................................................................................................ 2-2
:STOP ...................................................................................................................................... 2-2
:SINGle .................................................................................................................................... 2-3
:TFORce ................................................................................................................................... 2-3
:TLHAlf .................................................................................................................................... 2-3
IEEE 488.2 Common Commands................................................................................................ 2-4
*CLS ................................................................................................................................. 2-4
*ESE ................................................................................................................................. 2-5
*ESR? ............................................................................................................................... 2-6
*IDN? ............................................................................................................................... 2-6
*OPC ................................................................................................................................. 2-7
*RST ................................................................................................................................. 2-7
*SRE ................................................................................................................................. 2-8
*STB? ............................................................................................................................... 2-9
*TST? ............................................................................................................................. 2-10
:ACQuire Commands ............................................................................................................... 2-11
:ACQuire:AVERages .......................................................................................................... 2-11
:ACQuire:MDEPth ............................................................................................................. 2-12
:ACQuire:SRATe? .............................................................................................................. 2-12
:ACQuire:TYPE ................................................................................................................. 2-13
:ACQuire:AALias ............................................................................................................... 2-14
:BUS<n> Commands .............................................................................................................. 2-15
:BUS<n>:MODE .............................................................................................................. 2-15
:BUS<n>:DISPlay ............................................................................................................ 2-16
:BUS<n>:FORMat ............................................................................................................ 2-16
:BUS<n>:EVENt .............................................................................................................. 2-17
:BUS<n>:EEXPort ............................................................................................................ 2-17
:BUS<n>:DATA? .............................................................................................................. 2-18
:BUS<n>:PARallel ............................................................................................................ 2-19
:BUS<n>:RS232 (Option) ................................................................................................. 2-24
MSO2000A/DS2000A Programming Guide
RIGOL Contents
:BUS<n>:IIC (Option) ...................................................................................................... 2-32
:BUS<n>:SPI (Option) ...................................................................................................... 2-36
:BUS<n>:CAN (Option) .................................................................................................... 2-46
:CALCulate Commands ............................................................................................................ 2-51
:CALCulate:MODE ............................................................................................................. 2-51
:CALCulate:ADD ............................................................................................................... 2-52
:CALCulate:SUB ................................................................................................................ 2-55
:CALCulate:MULTiply ......................................................................................................... 2-58
:CALCulate:DIVision .......................................................................................................... 2-61
:CALCulate:FFT ................................................................................................................ 2-64
:CALCulate:LOGic ............................................................................................................. 2-72
:CALCulate:ADVanced ....................................................................................................... 2-76
:CALibrate Commands ............................................................................................................. 2-80
:CALibrate:DATE? ............................................................................................................. 2-80
:CALibrate:STARt .............................................................................................................. 2-80
:CALibrate:TIME? ............................................................................................................. 2-81
:CALibrate:QUIT ............................................................................................................... 2-81
:CHANnel<n> Commands........................................................................................................ 2-82
:CHANnel<n>:BWLimit ..................................................................................................... 2-82
:CHANnel<n>:COUPling ................................................................................................... 2-83
:CHANnel<n>:DISPlay ...................................................................................................... 2-83
:CHANnel<n>:INVert ........................................................................................................ 2-84
:CHANnel<n>:IMPedance ................................................................................................. 2-84
:CHANnel<n>:OFFSet....................................................................................................... 2-85
:CHANnel<n>:SCALe ........................................................................................................ 2-86
:CHANnel<n>:PROBe ....................................................................................................... 2-87
:CHANnel<n>:UNITs ........................................................................................................ 2-87
:CHANnel<n>:VERNier ..................................................................................................... 2-88
:CHANnel<n>:TCAL ......................................................................................................... 2-89
:CURSor Commands ................................................................................................................ 2-90
:CURSor:MODE ................................................................................................................ 2-90
:CURSor:MANual .............................................................................................................. 2-91
:CURSor:TRACk ................................................................................................................ 2-99
:DISPlay Commands .............................................................................................................. 2-104
:DISPlay:CLEar ............................................................................................................... 2-104
:DISPlay:TYPE ................................................................................................................ 2-105
:DISPlay:GRADing:TIME ................................................................................................. 2-106
:DISPlay:WBRightness .................................................................................................... 2-106
:DISPlay:GRID ............................................................................................................... 2-107
:DISPlay:GBRightness ..................................................................................................... 2-107
:DISPlay:MPERsistence ................................................................................................... 2-108
:DISPlay:DATA? ............................................................................................................. 2-109
:FUNCtion Commands ........................................................................................................... 2-111
:FUNCtion:WRMode ........................................................................................................ 2-111
IV MSO2000A/DS2000A Programming Guide
Contents RIGOL
V
:FUNCtion:WRECord ....................................................................................................... 2-112
:FUNCtion:WREPlay ........................................................................................................ 2-115
:FUNCtion:WANalyze ...................................................................................................... 2-120
:LA Commands (For MSO2000A/MSO2000A-S) ....................................................................... 2-128
:LA:STATe ..................................................................................................................... 2-128
:LA:ACTive .................................................................................................................... 2-129
:LA:DISPlay ................................................................................................................... 2-130
:LA:AUTosort ................................................................................................................. 2-130
:LA:DELete .................................................................................................................... 2-131
:LA:SIZE ........................................................................................................................ 2-131
:LA:DIGital<n>:DISPlay ................................................................................................. 2-132
:LA:DIGital<n>:POSition ................................................................................................ 2-132
:LA:DIGital<n>:LABel .................................................................................................... 2-133
:LA:POD<n>:DISPlay ..................................................................................................... 2-133
:LA:POD<n>:THReshold ................................................................................................. 2-134
:LA:GROup<n>:APPend ................................................................................................. 2-134
:LA:BUS<n>:CURRent .................................................................................................... 2-135
:LA:BUS<n>:DISPlay ..................................................................................................... 2-135
:LA:BUS<n>:CHANnel .................................................................................................... 2-136
:LA:BUS<n>:FORMat ..................................................................................................... 2-136
:LAN Commands ................................................................................................................... 2-137
:LAN:DHCP .................................................................................................................... 2-137
:LAN:AUToip .................................................................................................................. 2-138
:LAN:GATeway ............................................................................................................... 2-139
:LAN:DNS ...................................................................................................................... 2-139
:LAN:MAC? .................................................................................................................... 2-140
:LAN:MANual ................................................................................................................. 2-140
:LAN:INITiate ................................................................................................................ 2-141
:LAN:IPADdress ............................................................................................................. 2-141
:LAN:SMASk .................................................................................................................. 2-142
:LAN:STATus? ................................................................................................................ 2-142
:LAN:VISA? .................................................................................................................... 2-143
:LAN:APPLy .................................................................................................................... 2-143
:MASK Commands ................................................................................................................ 2-144
:MASK:ENABle ............................................................................................................... 2-144
:MASK:SOURce .............................................................................................................. 2-145
:MASK:OPERate ............................................................................................................. 2-145
:MASK:MDISplay ............................................................................................................ 2-146
:MASK:SOOutput ........................................................................................................... 2-146
:MASK:OUTPut............................................................................................................... 2-147
:MASK:X ........................................................................................................................ 2-148
:MASK:Y ........................................................................................................................ 2-148
:MASK:CREate ............................................................................................................... 2-148
:MASK:PASSed? ............................................................................................................. 2-149
MSO2000A/DS2000A Programming Guide
RIGOL Contents
:MASK:FAILed? ............................................................................................................... 2-149
:MASK:TOTal? ................................................................................................................ 2-149
:MASK:RESet .................................................................................................................. 2-150
:MASK:DATA .................................................................................................................. 2-150
:MEASure Commands ............................................................................................................ 2-151
:MEASure:SOURce .......................................................................................................... 2-152
:MEASure:COUNter:SOURce ............................................................................................ 2-153
:MEASure:COUNter:VALue? ............................................................................................. 2-153
:MEASure:CLEar ............................................................................................................. 2-154
:MEASure:RECover ......................................................................................................... 2-154
:MEASure:ADISplay ........................................................................................................ 2-155
:MEASure:AMSource ....................................................................................................... 2-155
:MEASure:STATistic:DISPlay ............................................................................................ 2-156
:MEASure:STATistic:MODE .............................................................................................. 2-156
:MEASure:STATistic:RESet ............................................................................................... 2-157
:MEASure:SETup:TYPE ................................................................................................... 2-157
:MEASure:SETup:MAX ..................................................................................................... 2-158
:MEASure:SETup:MID ..................................................................................................... 2-158
:MEASure:SETup:MIN ..................................................................................................... 2-158
:MEASure:SETup:PSA ...................................................................................................... 2-159
:MEASure:SETup:PSB ...................................................................................................... 2-159
:MEASure:SETup:DSA ..................................................................................................... 2-160
:MEASure:SETup:DSB ..................................................................................................... 2-160
:MEASure:AREA .............................................................................................................. 2-161
:MEASure:CREGion:CAX .................................................................................................. 2-162
:MEASure:CREGion:CBX .................................................................................................. 2-162
:MEASure:HISTory:DISPlay ............................................................................................. 2-163
:MEASure:HISTory:DMODe .............................................................................................. 2-163
:MEASure:FDELay ........................................................................................................... 2-164
:MEASure:F2RDelay ........................................................................................................ 2-166
:MEASure:FPHase ........................................................................................................... 2-168
:MEASure:F2RPhase ....................................................................................................... 2-170
:MEASure:FREQuency ..................................................................................................... 2-172
:MEASure:FTIMe ............................................................................................................ 2-174
:MEASure:NDUTy ............................................................................................................ 2-176
:MEASure:NWIDth .......................................................................................................... 2-178
:MEASure:OVERshoot ..................................................................................................... 2-180
:MEASure:PDUTy ............................................................................................................ 2-182
:MEASure:PERiod ........................................................................................................... 2-184
:MEASure:PREShoot ....................................................................................................... 2-186
:MEASure:PWIDth .......................................................................................................... 2-188
:MEASure:RTIMe ............................................................................................................ 2-190
:MEASure:RDELay .......................................................................................................... 2-192
:MEASure:R2FDelay ........................................................................................................ 2-194
VI MSO2000A/DS2000A Programming Guide
Contents RIGOL
VII
:MEASure:RPHase .......................................................................................................... 2-196
:MEASure:R2FPhase ....................................................................................................... 2-198
:MEASure:VAMP ............................................................................................................. 2-200
:MEASure:VAVG ............................................................................................................. 2-202
:MEASure:VBASe ............................................................................................................ 2-204
:MEASure:VMAX ............................................................................................................. 2-206
:MEASure:VMIN ............................................................................................................. 2-208
:MEASure:VPP ............................................................................................................... 2-210
:MEASure:VRMS ............................................................................................................. 2-212
:MEASure:PVRMs ........................................................................................................... 2-214
:MEASure:VTOP ............................................................................................................. 2-216
:MEASure:MARea ........................................................................................................... 2-218
:MEASure:MPARea ......................................................................................................... 2-220
:OUTPut<n> Commands (For MSO2000A-S) .......................................................................... 2-222
:OUTPut[<n>][:STATe] .................................................................................................. 2-222
:OUTPut[<n>]:IMPedance .............................................................................................. 2-223
:RECall Commands ............................................................................................................... 2-224
:RECall:SETup ................................................................................................................ 2-224
:RECall:TRACe ............................................................................................................... 2-225
:RECall:WAVeform ......................................................................................................... 2-225
:REFerence Commands ......................................................................................................... 2-226
:REFerence<n>:CURRent ............................................................................................... 2-226
:REFerence<n>:ENABle ................................................................................................. 2-227
:REFerence:COLor .......................................................................................................... 2-227
:REFerence:CURRent? .................................................................................................... 2-228
:REFerence:DISPlay ....................................................................................................... 2-228
:REFerence:RESet .......................................................................................................... 2-228
:REFerence:SAVe ........................................................................................................... 2-229
:REFerence:SOURce ....................................................................................................... 2-229
:REFerence:VSCale ......................................................................................................... 2-230
:REFerence:VOFFset ...................................................................................................... 2-231
:SAVE Commands ................................................................................................................. 2-232
:SAVE:CSV[:STARt] ........................................................................................................ 2-233
:SAVE:CSV:FACTors ....................................................................................................... 2-234
:SAVE:CSV:LENGth......................................................................................................... 2-234
:SAVE:FORMat ............................................................................................................... 2-235
:SAVE:IMAGe[:STARt] .................................................................................................... 2-235
:SAVE:IMAGe:TYPE ........................................................................................................ 2-236
:SAVE:IMAGe:FACTors ................................................................................................... 2-236
:SAVE:SETup[:STARt] .................................................................................................... 2-237
:SAVE:TRACe[:STARt] .................................................................................................... 2-238
:SAVE:WAVeform[:STARt] .............................................................................................. 2-238
:SAVE:REFerence[:STARt] .............................................................................................. 2-239
:SAVE:MTESt[:STARt] .................................................................................................... 2-240
MSO2000A/DS2000A Programming Guide
RIGOL Contents
:SAVE:ARB[:STARt] ........................................................................................................ 2-241
:SOURce<n> Commands (For MSO2000A-S) .......................................................................... 2-242
[:SOURce<n>]:FREQuency[:FIXed] ................................................................................. 2-243
[:SOURce<n>]:PHASe[:ADJust] ...................................................................................... 2-243
[:SOURce<n>]:PHASe:INITiate ....................................................................................... 2-244
[:SOURce<n>]:FUNCtion[:SHAPe] ................................................................................... 2-245
[:SOURce<n>]:FUNCtion:RAMP:SYMMetry ...................................................................... 2-246
[:SOURce<n>]:VOLTage[:LEVel][:IMMediate][:AMPLitude] ............................................... 2-247
[:SOURce<n>]:VOLTage[:LEVel][:IMMediate]:OFFSet....................................................... 2-248
[:SOURce<n>]:PULSe:DCYCle ........................................................................................ 2-249
[:SOURce<n>]:MOD[:STATe] .......................................................................................... 2-250
[:SOURce<n>]:MOD:TYPe .............................................................................................. 2-251
[:SOURce<n>]:MOD:AM[:DEPTh] ................................................................................... 2-251
[:SOURce<n>]:MOD:AM:INTernal:FREQuency ................................................................. 2-252
[:SOURce<n>]:MOD:AM:INTernal:FUNCtion .................................................................... 2-252
[:SOURce<n>]:MOD:FM[:DEVIation] ............................................................................... 2-253
[:SOURce<n>]:MOD:FM:INTernal:FREQuency ................................................................. 2-253
[:SOURce<n>]:MOD:FM:INTernal:FUNCtion .................................................................... 2-254
[:SOURce<n>]:APPLy:NOISe .......................................................................................... 2-255
[:SOURce<n>]:APPLy:PULSe .......................................................................................... 2-255
[:SOURce<n>]:APPLy:RAMP ........................................................................................... 2-255
[:SOURce<n>]:APPLy:SINusoid....................................................................................... 2-255
[:SOURce<n>]:APPLy:SQUare......................................................................................... 2-255
[:SOURce<n>]:APPLy:USER ............................................................................................ 2-255
[:SOURce<n>]:APPLy? ................................................................................................... 2-257
:SYSTem Commands ............................................................................................................. 2-258
:SYSTem:AOUTput ......................................................................................................... 2-259
:SYSTem:AUToscale ........................................................................................................ 2-259
:SYSTem:BEEPer ............................................................................................................ 2-260
:SYSTem:DATE ............................................................................................................... 2-260
:SYSTem:ERRor[:NEXT]? ................................................................................................. 2-261
:SYSTem:EXPand ............................................................................................................ 2-261
:SYSTem:GAMount? ........................................................................................................ 2-262
:SYSTem:GPIB ............................................................................................................... 2-262
:SYSTem:KEY:PRESs ....................................................................................................... 2-263
:SYSTem:KEY:INCRease .................................................................................................. 2-265
:SYSTem:KEY:DECRease ................................................................................................. 2-265
:SYSTem:LANGuage ........................................................................................................ 2-266
:SYSTem:OPTion:INSTall ................................................................................................ 2-267
:SYSTem:OPTion:UNINSTall ............................................................................................ 2-267
:SYSTem:OPTion:VALid? ................................................................................................. 2-268
:SYSTem:PON ................................................................................................................ 2-268
:SYSTem:PSTatus ........................................................................................................... 2-269
:SYSTem:RAMount? ........................................................................................................ 2-269
VIII MSO2000A/DS2000A Programming Guide
Contents RIGOL
IX
:SYSTem:RESet .............................................................................................................. 2-269
:SYSTem:SSAVer:TIME ................................................................................................... 2-270
:SYSTem:SETup ............................................................................................................. 2-270
:SYSTem:TIME .............................................................................................................. 2-271
:SYSTem:UDEVice .......................................................................................................... 2-271
:SYSTem:VERSion? ........................................................................................................ 2-272
:TIMebase Commands .......................................................................................................... 2-273
:TIMebase:DELay:ENABle ............................................................................................... 2-273
:TIMebase:DELay:OFFSet ............................................................................................... 2-274
:TIMebase:DELay:SCALe ................................................................................................ 2-274
:TIMebase[:MAIN]:OFFSet.............................................................................................. 2-275
:TIMebase[:MAIN]:SCALe ............................................................................................... 2-276
:TIMebase:HREF:MODE .................................................................................................. 2-277
:TIMebase:HREF:POSition .............................................................................................. 2-277
:TIMebase:MODE ........................................................................................................... 2-278
:TIMebase:VERNier ........................................................................................................ 2-278
:TRACe<n> Commands (For MSO2000A-S) ............................................................................ 2-279
[:TRACe<n>]:DATA ....................................................................................................... 2-279
[:TRACe<n>]:DATA:DAC16 ............................................................................................ 2-280
[:TRACe<n>]:DATA:DAC ................................................................................................ 2-281
[:TRACe<n>]:DATA:LOAD? ............................................................................................ 2-282
[:TRACe<n>]:DATA:POINts ............................................................................................ 2-282
[:TRACe<n>]:DATA:POINts:INTerpolate .......................................................................... 2-283
[:TRACe<n>]:DATA:VALue ............................................................................................. 2-284
:TRIGger Commands ............................................................................................................ 2-285
:TRIGger:COUPling ........................................................................................................ 2-286
:TRIGger:HOLDoff ......................................................................................................... 2-286
:TRIGger:MODE ............................................................................................................. 2-287
:TRIGger:NREJect .......................................................................................................... 2-287
:TRIGger:STATus? .......................................................................................................... 2-288
:TRIGger:SWEep ............................................................................................................ 2-289
:TRIGger:CAN (Option) .................................................................................................. 2-290
:TRIGger:DELay (Option) ............................................................................................... 2-295
:TRIGger:DURATion (Option) .......................................................................................... 2-298
:TRIGger:EDGe .............................................................................................................. 2-302
:TRIGger:IIC ................................................................................................................. 2-304
:TRIGger:NEDGe (Option) .............................................................................................. 2-310
:TRIGger:PATTern .......................................................................................................... 2-313
:TRIGger:PULSe ............................................................................................................. 2-316
:TRIGger:RS232............................................................................................................. 2-320
:TRIGger:RUNT ............................................................................................................. 2-326
:TRIGger:SHOLd ............................................................................................................ 2-330
:TRIGger:SLOPe ............................................................................................................. 2-334
:TRIGger:SPI ................................................................................................................. 2-339
MSO2000A/DS2000A Programming Guide
RIGOL Contents
:TRIGger:TIMeout (Option) ............................................................................................. 2-346
:TRIGger:USB (Option) ................................................................................................... 2-348
:TRIGger:VIDeo (HDTV Option)....................................................................................... 2-351
:TRIGger:WINDows (Option)........................................................................................... 2-356
:WAVeform Commands .......................................................................................................... 2-359
:WAVeform:SOURce ....................................................................................................... 2-361
:WAVeform:MODE .......................................................................................................... 2-362
:WAVeform:FORMat ........................................................................................................ 2-363
:WAVeform:POINts ......................................................................................................... 2-363
:WAVeform:DATA? .......................................................................................................... 2-364
:WAVeform:XINCrement? ................................................................................................ 2-368
:WAVeform:XORigin? ...................................................................................................... 2-369
:WAVeform:XREFerence? ................................................................................................ 2-369
:WAVeform:YINCrement? ................................................................................................ 2-370
:WAVeform:YORigin? ...................................................................................................... 2-370
:WAVeform:YREFerence? ................................................................................................ 2-370
:WAVeform:STARt ........................................................................................................... 2-371
:WAVeform:STOP ........................................................................................................... 2-372
:WAVeform:BEGin ........................................................................................................... 2-372
:WAVeform:END ............................................................................................................. 2-373
:WAVeform:RESet ........................................................................................................... 2-373
:WAVeform:PREamble? ................................................................................................... 2-374
:WAVeform:STATus? ....................................................................................................... 2-375
3 Programming Demos .......................................................................................................... 3-1
Programming Preparations ......................................................................................................... 3-2
Excel Programming Demo .......................................................................................................... 3-3
LabVIEW Programming Demo .................................................................................................... 3-7
MATLAB Programming Demo ................................................................................................... 3-11
Visual Basic 6.0 Programming Demo ........................................................................................ 3-13
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
RIGOL 1 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.
The topics of this chapter:
:AUToscale :CLEar :RUN :STOP :SINGle :TFORce :TLHAlf IEEE 488.2 Common Commands :ACQuire Commands :BUS<n> Commands :CALCulate Commands :CALibrate Commands :CHANnel<n> Commands :CURSor Commands :DISPlay Commands :FUNCtion Commands :LA Commands (Fo r MSO2000A/MSO2000A-S) :LAN Commands :MASK Commands :MEASure Commands :OUTPut<n> Commands (For MSO2000A-S) :RECall Commands :REFerence Commands :SAVE Commands :SOURce<n> Commands (For MSO2000A-S) :SYSTem Commands :TIMebase Commands :TRACe<n> Commands (For MSO2000A-S) :TRIGger Commands :WAVeform Commands
Note:
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
RIGOL 2 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
RIGOL 2 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.
*CLS *ESE *ESR? *IDN? *OPC *RST *SRE *STB? *TST?

*CLS

Syntax
*CLS
Description
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:
Bit Weights Name Enable 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.
Example
*ESE 16 /*Bit 4 is enabled*/ *ESE? /*The query retur ns 16*/
MSO2000A/DS2000A Programming Guide
RIGOL 2 Command System

*ESR?

Syntax
*ESR?
Description Query the event status register for the standard event register set.
Explanation Definit ions of the bits of ESE register:
Bit Weights Name Enable 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 Control 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.
*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
RIGOL 2 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:
Bit Weights Name Enable 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:
Bit Weights Name Enable 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
RIGOL 2 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*/
2-10 MSO2000A/DS2000A Programming Guide
2 Command System RIGOL
2-11

:ACQuire Commands

:ACQuire:AVERages :ACQuire:MDEPth :ACQuire:SRATe? :ACQuire:TYPE :ACQuire:AALias

:ACQuire:AVERages

Syntax
:ACQuire:AVERages <count> :ACQuire:AVERages?
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
RIGOL 2 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
Explanation
Interweave: AUTO|14000|140000|1400000|14000000|56000000 (option). Non-interweave: AUTO|7000|70000|700000|7000000|28000000 (option).
Return Format
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
Explanation NORMal: 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
RIGOL 2 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
+ 380 hidden pages