Page 1
RIGOL Programming Guide DS1000B Series Digital Oscilloscope DS1204B/DS1104B/DS1074B Feb. 2014 RIGOL Technologies, Inc.
Page 3
Notices RIGOL products are protected by patent law in and outside of P.R.C.. RIGOL Technologies, Inc. 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.
Programming Introduction RIGOL Chapter 1 Programming Introduction This chapter provides guidance to the remote control programming of the DS1000B series digital oscilloscopes and introduction of the commands. This chapter includes: Communication Interface Command Introduction Command Syntax Symbol Description...
RIGOL Programming Introduction Communication Interface Computers can communicate with the oscilloscope by sending and receiving messages over USB or LAN interface. Commands in the form of ASCII character strings are embedded in your computer to make control easier. Operations that you can do with a computer and the oscilloscope include: Set up the oscilloscope;...
Programming Introduction RIGOL Command Introduction Command Syntax The commands system of DS1000B series oscilloscope is a multistage tree structure, and each of sub-system is consists of a “Root” keyword and multilayered keywords. The commands are always begin with a “:”(except for IEEE commands) and the keywords are also separated by “:”;...
RIGOL Programming Introduction Symbol Description The following symbols are not “real” parts of the commands, but they are usually used to assist to explain the parameters containd in a command line. Braces { } The parameters or contents enclosed in “{}” must be selected, and only one parameter or content could be selected once.
Programming Introduction RIGOL Command Input All the comands are not sensitive to both capital letter and lowercase, so you can use any kind of them. But if use abbreviation, the capital letters specified in commands must be written completely. For example:...
RIGOL Programming Introduction Parameter Type The commands contains 5 kinds of parameters, different parameters has different setting methods. 1. Boolean The parameter should be “OFF”, “ON”, “0” or “1”. For example: :DISPlay:PERSist {{1|ON}|{0|OFF}} “ON” and “1” denotes trun on (enable) the function, “OFF” and “0” denotes turn off (disable) the fucntion.
Command Systems RIGOL Chapter 2 Command Systems In this chapter, we will introduce every comand in the DS1000B command systems. The introduction inludes command format, function description, query/Returned Format and some other notices that should pay attention to during using the commands.
RIGOL Command Systems General Commands IEEE Standards have defined some general commands which are applied to query basic information of the instrument or perform elementary operations. These commands always have 3 characters and with a “*” marker. DS1000B series support the following General Commands: *IDN? ...
Page 15
*IDN? Function: The command queries the manufacturer, the oscilloscope model, the product serial and the software version. Returned Format: manufacturer, <model>, <serial>, <version>. Example: Rigol Technologies, DS1204B, DS10000000, 00.02.04. *RST Command Format: *RST Function: The command resets the system. *LRN?
Page 16
RIGOL Command Systems *OPC? Command Format: *OPC? Function: The command queries whether the command operation has been completed. Returned Format: The query returns 0 or 1. 1 means operation has been completed, 0 means not. Programming Guide for DS1000B Series...
Command Systems RIGOL SYSTem Commands SYSTem Commands are used for the basic operations of an oscilloscope: RUN/STOP control, operation of the error queue and system setup data. SYSTem Commands include: :RUN :STOP :AUTO :SYSTem:ERRor :SYSTem:SETup ...
Page 18
RIGOL Command Systems :RUN Command Format: :RUN Function: Execute this command, the oscilloscope will start waveform sampling working. To stop working, execute :STOP command again. :STOP Command Format: :STOP Function: Execute this command, the oscilloscope will stop waveform sampling working.
Page 19
Command Systems RIGOL The query returns the last error, such as “Undefined header”. If there is no error, return “0, No error”. For details about system error codes, please refer to page 2-8: Programming Guide for DS1000B Series...
Page 20
RIGOL Command Systems System Error Code :SYSTem:SETup Command Format: :SYSTem:SETup <setup_data> :SYSTem:SETup? Function: The command downloads the system setup data. <setup data> is a binary data that meets IEEE 488.2 # format. Returned Format: The query returns the value of system setup data.
Page 21
Command Systems RIGOL System Error Code Up to 10 errors can be recorded in the system error queue. If not enough, the system will adopt FIFO manner to cover the original error record. The SYST:ERR? Command is used to read the first error code in the form of “error code, error description”, so as to reduce the error number of error queue.
Page 22
RIGOL Command Systems ERR_VIDEO_LINE_LIMIT, Video line limit ERR_REC_INTERVAL_LIMIT, Record interval limit ERR_REC_END_FRAME_LIMIT, Record end frame limit ERR_PLAY_INTERVAL_LIMIT, Play interval limit ERR_PLAY_START_FRAME_LIMIT, Play start frame limit ERR_PLAY_CUR_FRAME_LIMIT, Play current frame limit ERR_PLAY_END_FRAME_LIMIT, Play end frame limit ERR_STOARAGE_START_FRAME_LIMIT, Storage start frame limit...
Page 23
Command Systems RIGOL ERR_PF_OUTPUT, PassFail Out ERR_MISSING_HW, Missing Hardware ERR_OUT_OF_RANGE Out of range ERR_CANNOT_EXECURE Can’t execute Programming Guide for DS1000B Series 2-11...
RIGOL Command Systems ACQuire Commands ACQuire Commands are used to set the acquisition mode for oscilloscope. ACQuire Commands include: :ACQuire:TYPE :ACQuire:MODE :ACQuire:AVERages :ACQuire:SRATe? We will give detailed introductions for each command in the following parts. 2-12...
Page 25
Command Systems RIGOL :ACQuire:TYPE Command Format: :ACQuire:TYPE <type> :ACQuire:TYPE? Function: The command sets the acquisition type. The <type>may be NORMal(common sample), AVERage(average sample) or PEAKdetect(peak detection). Returned Format: The query returns Normal or AVERAGE, PEAKDETECT. Example: :ACQ:TYPE AVERage Set the acquisition type as average acquisition.
Page 26
RIGOL Command Systems :ACQuire:AVERages <count> :ACQuire:AVERages? Function: The command sets the average acquisition time. The <count> range is 2~256, and the count increases by the power operation of 2. Returned Format: The query returns 2 or 4, 8, 16, 32, 64, 128, 256.
Command Systems RIGOL DISPlay Commands DISPlay Commands are used to set the display system. DISPlay Commands include: :DISPlay:TYPE :DISPlay:GRID :DISPlay:PERSist :DISPlay:MNUDisplay :DISPlay:MNUStatus :DISPlay:SCReen :DISPlay:CLEar :DISPlay:BRIGhtness :DISPlay:INTensity :DISPlay:DATA? We will give detailed introductions for each command in the following parts.
Page 28
RIGOL Command Systems :DISPlay:TYPE Command Format: :DISPlay:TYPE <type> :DISPlay:TYPE? Function: The command sets the display type of acquisition points. The <type> may be VECTors (acquisition points are connected by lines) or DOTS (acquisition points are displayed by dots). Returned Format: The query returns VECTORS or DOTS.
Page 29
Command Systems RIGOL Command Format: :DISPlay:PERSist {{1|ON}|{0|OFF}} :DISPlay:PERSist? Function: The command sets waveform persist function ON (The waveform is shown until waveform persist function is off or relevant settings are changed.) or OFF (The waveform is updated as high refresh rate).
Page 30
RIGOL Command Systems :DISPlay:MNUStatus {{1|ON}|{0|OFF}} :DISPlay:MNUStatus? Function: The command sets menu display function ON (Performing menu operation) or OFF (viewing the waveform). Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :DISP:MNUS ON Set menu display function on.
Page 31
Command Systems RIGOL The command clears the out of date waveforms on the screen during waveform persist. :DISPlay:BRIGhtness Command Format: :DISPlay:BRIGhtness <count> :DISPlay:BRIGhtness? Function: The command sets the brightness of grid. The <count> range is 0~100, and the bigger the count is, the brighter the grid becomes.
Page 32
RIGOL Command Systems 10. :DISPlay:DATA? Command Format: :DISPlay:DATA? Function: The command queries image data on the current screen. The data format accords with IEEE 488.2 standard. The data structure is: #800078788+the data of 8 bit bitmap. 2-20 Programming Guide for DS1000B Series...
Command Systems RIGOL TIMebase Commands TIMebase Commands are used to set horizontal scale and horizontal offset. Changing horizontal scale makes the waveform enlarge or shrink; and changing horizontal position will lead the waveform offset relative to center screen. TIMebase Commands include: :TIMebase:MODE ...
Page 34
RIGOL Command Systems :TIMebase:MODE Command Format: :TIMebase:MODE <mode> :TIMebase:MODE? Function: The command sets the scan mode of horizontal timebase as MAIN (main time base) or DELayed (zoomed scan time base). Returned Format: The query returns MAIN or DELAYED. Example: :TIM:MODE MAIN Set the scan mode as main time base.
Page 35
Command Systems RIGOL :TIM:OFFS? Return 1.000e000. :TIMebase:DELayed:OFFSet Command Format: :TIMebase:DELayed:OFFSet <offset> :TIMebase:DELayed:OFFSet? Function: The command sets the timebase offset of delayed scan, that is the offset of the waveform position relative to center screen. In NORMAL mode, <offset>: 1s ~ memory capacitance;...
Page 36
The command sets the timebase scale of main mode, and the unit is s/div. In NORMAL mode, different types of instruments have different sweep ranges: DS1204B , <scale_val> range: 1ns/div~50s/div. DS1104B, <scale_val>range: 2ns/div~50s/div. DS1074B, <scale_val>range: 5ns/div~50s/div. In SCAN mode, <scale_val>range: 50ms ~ 50s.
Page 37
Command Systems RIGOL Returned Format: The query returns the value of timebase scale, and the unit is s. Example: :TIM:MODE DEL Set the scan mode as delayed scan. :TIM:DEL:SCAL 2 Set the timebase scale as 2s. :TIM:DEL:SCAL? Return 2.000e000. :TIMebase:FORMat Command Format: :TIMebase:FORMat <vlaue>...
RIGOL Command Systems TRIGger Commands Trigger system makes the meaningful waveform shown steadily. Trigger determines when the oscilloscope starts to acquire data and to display a waveform. When trigger is set up properly, it can convert unstable displays into meaningful waveforms.
RIGOL Command Systems Trigger Control :TRIGger:MODE Command Format: :TRIGger:MODE <mode> :TRIGger:MODE? Function: The command sets the trigger mode as EDGE, PULSe, VIDEO, ALTernation or PATTern trigger. Returned Format: The query returns EDGE or PULSE, VIDEO, ALTERNATION, PATTERN. Example: :TRIG:MODE EDGE Set the trigger mode as edge trigger.
Page 41
Command Systems RIGOL Example: :TRIG:EDGE:SOUR CHAN1 Set the edge trigger source as channel 1. :TRIG:EDGE:SOUR? Return CH1. :TRIGger<mode>:LEVel Command Format: :TRIGger<mode>:LEVel <level>[,<src>] :TRIGger<mode>:LEVel? [,<src>] Function: The command sets the voltage level of Edge, Pulse or Video trigger. <mode> may be :EDGE, :PULSe or :VIDEO or :PATTern.
Page 42
RIGOL Command Systems NORMal: Acquire waveform when trigger occurred; SINGle: Execute once trigger when all the condition are marched and stop. Returned Format: The query returns AUTO or NORMAL, SINGLE. Example: :TRIG:EDGE :SWE AUTO Set the trigger type as AUTO.
Page 43
Command Systems RIGOL Returned Format: The query returns DC, AC or LF. Example: :TRIG:COUP DC Set the coupling mode as DC. :TRIG:COUP? Return DC. :TRIGger:HFREject Command Format: :TRIGger:HFREject {{1|ON}|{0|OFF}} :TRIGger:HFREject? Function: The command sets high frequency reject function on or off.
Page 44
RIGOL Command Systems Example: :TRIG:HOLD 0.0001 Set the holdoff time as 100μs. :TRIG:HOLD? Return 1.000e-004. :TRIGger:STATus? Query Format: :TRIGger:STATus? Function: The command queries the current status of the oscilloscope. The status may be RUN, STOP, T’ D, WAIT, SCAN or AUTO.
Page 45
Command Systems RIGOL Command Format: :SINGLE Function: The command sets the trigger mode as Single trigger, means that collect a waveform when detect a trigger signal, then stop running. Programming Guide for DS1000B Series 2-33...
RIGOL Command Systems EDGE Trigger :TRIGger:EDGE:SLOPe Command Format: :TRIGger:EDGE:SLOPe {POSitive|NEGative|ALTernation} :TRIGger:EDGE:SLOPe? Function: The command sets the trigger edge as POSitive (rising edge), NEGative (falling edge) or ALTernation (rising and falling edge). Returned Format: The query returns POSITIVE or NEGATIVE, ALTERNATION.
RIGOL Command Systems VIDEO Trigger :TRIGger:VIDEO:MODE Command Format: :TRIGger:VIDEO:MODE <mode> :TRIGger:VIDEO:MODE? Function: The command sets the trigger sync mode as ODDfield, EVENfield, LINE or ALLlines. Returned Format: The query returns ODD FIELD, EVEN FIELD, LINE or ALL LINES. Example: :TRIG:VIDEO:MODE EVEN Set the trigger sync mode as even field.
Page 49
Command Systems RIGOL :TRIGger:VIDEO:STANdard Command Format: :TRIGger:VIDEO:STANdard {NTSC|PALSecam} :TRIGger:VIDEO:STANdard? Function: The command sets the video standard as NTSC or PAL/SECAM. Returned Format: The query returns NTSC or PAL/SECAM. Example: :TRIG:VIDEO:STAN PALS Set the video standard as PAL/SECAM. :TRIG:VIDEO:STAN? Return PAL/SECAM.
RIGOL Command Systems PATTern Trigger :TRIGger:PATTern:PATTern Command Format: :TRIGger:PATTern:PATTern <value>,<mask>,<ext source>[,<edge source>,<edge>] :TRIGger:PATTern:PATTern? Function: The command sets the code pattern of signals. <value>: Code pattern values of the channels. It is a 16 bit unsigned integer (High is 1, Low is 0).
Command Systems RIGOL ALTernation Trigger :TRIGger:ALTernation:SOURce Command Format: :TRIGger:ALTernation:SOURce <source> :TRIGger:ALTernation:SOURce? Function: The command selects the alternation trigger channel. The <source> may be CH1CH2, CH1CH3, CH1CH4, CH2CH3, CH2CH4 or CH3CH4. Returned Format: The query returns CH1CH2 or CH1CH3, CH1CH4, CH2CH3, CH2CH4, CH3CH4.
Page 52
2ns~20ms, and the <source> may be SOURceA or SOURceB, and the source A and B are varying with the current alternation channel. In NORMAL mode, different types of instruments have different sweep ranges: DS1204B, <scale_val> range:1ns/div~50s/div. DS1104B, <scale_val>range:2ns/div~50s/div. DS1074B, <scale_val>range:5ns/div~50s/div.
Page 53
Command Systems RIGOL :TRIG:ALT:TSCAL? SOURB Return 1.000e-003. :TRIGger:ALTernation:TimeOFFSet Command Format: :TRIGger:ALTernation:TimeOFFSet <value>[,<source>] :TRIGger:ALTernation:TimeOFFSet? [<source>] Function: The command sets the timebase offset. In NORMAL mode, <value>: 1s ~ memory capacitance; In STOP mode, <value: -500s ~ +500s. Returned Format: The query returns the value of timebase offset, and the unit is s.
Page 54
RIGOL Command Systems Example: :TRIG:ALT:LEV 2, SOURB Set the trigger voltage level as 2V. :TRIG:ALT:LEV? SOURB Return 2.000e000. :TRIGger:ALTernation:EDGE:SLOPe Command Format: :TRIGger:ALTernation:EDGE:SLOPe <value>[,<source>] :TRIGger:ALTernation:EDGE:SLOPe? [<source>] Function: The command sets the edge type of edge trigger in current channel as POSitive (rising edge) or NEGative (falling edge).
Page 55
Command Systems RIGOL -LESS THAN, –EQUAL. Example: :TRIG:ALT:PULS:MODE +GRE, SOURB Set the trigger condition. :TRIG:ALT:PULS:MODE? SOURB Return +GREATER THAN. :TRIGger:ALTernation:PULSe:TIME Command Format: :TRIGger:ALTernation:PULSe:TIME <value>[,<source>] :TRIGger:ALTernation:PULSe:TIME? [<source>] Function: The command sets the pulse width, the value range is 20ns~10s. The <source>...
Page 56
RIGOL Command Systems Example: :TRIG:ALT:VIDEO:POL POS,SOURB Set the video polarity as positive. :TRIG:ALT:VIDEO:POL? SOURB Return POSITIVE. 11. :TRIGger:ALTernation:VIDEO:STANdard Command Format: :TRIGger:ALTernation:VIDEO:STANdard {NTSC|PALSecam}[,<source>] :TRIGger:ALTernation:VIDEO:STANdard? [<source>] Function: The command sets the video standard as NTSC or PAL/SECAM. The <source> may be SOURceA or SOURceB, and the source A and B are varying with the current alternation channel.
Page 57
Command Systems RIGOL Example: :TRIG:ALT:VIDEO:MODE ALLLINES,SOURB Set the sync mode as all lines. :TRIG:ALT:VIDEO:MODE? SOURB Return ALL LINES. 13. :TRIGger:ALTernation:VIDEO:LINE Command Format: :TRIGger:ALTernation:VIDEO:LINE <value>[,<source>] :TRIGger:ALTernation:VIDEO:LINE? [<source>] Function: The command sets the number of sync specified line. In NTSC standard, the <value>...
Page 58
RIGOL Command Systems Returned Format: The query returns DC, AC or LF. Example: :TRIG:ALT:COUP DC, SOURB Set the coupling mode as DC. :TRIG:ALT:COUP? SOURB Return DC. 15. :TRIGger:ALTernation:HFREject Command Format: :TRIGger:ALTernation:HFREject {{1|ON}|{0|OFF}} :TRIGger:ALTernation:HFREject? Function: The command sets high frequency reject function of ALTernation Trigger on or off.
Page 59
Command Systems RIGOL The query returns the value of holdoff time, and the unit is s. Example: :TRIG:HOLD 0.0001, SOURA Set the holdoff time of source A as 100us. :TRIG:HOLD? SOURA Return 1.000e-004. 17. :TRIGger:ALTernation:SENSitivity Command Format: :TRIGger:ALTernation:SENSitivity <count>[,<source>] :TRIGger:ALTernation:SENSitivity? [<source>]...
RIGOL Command Systems MATH Commands MATH Commands are used to display the result of adding, subtracting, multiplying and FFT operation for the signals from CH1, CH2, CH3 and CH4. The results can be measured by the grid and the cursor.
Page 61
Command Systems RIGOL 1. :MATH:DISPlay Command Format: :MATH:DISPlay {{1|ON}|{0|OFF}} :MATH:DISPlay? Function: The command sets Math waveform on or off. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :MATH:DISP ON Set Math waveform on. :MATH:DISP? Return 1.
RIGOL Command Systems CHANnel Commands CHANnel Commands are used to set the vertical system from every channel separately. CHANnel Commands include: :CHANnel<n>:BWLimit :CHANnel<n>:COUPling :CHANnel<n>:DISPlay :CHANnel<n>:INVert :CHANnel<n>:OFFSet :CHANnel<n>:PROBe :CHANnel<n>:SCALe :CHANnel<n>:FILTer :CHANnel<n>:MEMoryDepth? :CHANnel<n>:VERNier ...
Page 63
Command Systems RIGOL :CHANnel<n>:BWLimit Command Format: :CHANnel<n>:BWLimit {{1|ON}|{0|OFF}} :CHANnel<n>:BWLimit? Function: The command sets bandwidth limit function ON (limit band width to 20MHz to reduce noise) or OFF (full band width). The <n> may be 1, 2, 3 or 4. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF.
Page 64
RIGOL Command Systems Command Format: :CHANnel<n>:DISPlay {{1|ON}|{0|OFF}} :CHANnel<n>:DISPlay? Function: The command sets the channel ON or OFF. The <n> may be 1, 2, 3 or 4. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Examples: :CHAN2:DISP ON Set channel 2 on.
Page 65
Command Systems RIGOL Function: The command sets the vertical offset. The <n> may be 1, 2, 3 or 4. Scale≥250mV, <offset>: -40V~ +40V; Scale<250mV, <offset>: -2V ~ +2V. Returned Format: The query returns the value of offset, and the unit is V.
Page 66
RIGOL Command Systems The command sets the vertical scale for magnifying waveform. The <n> may be 1, 2, 3 or 4. Probe 0.001X, <range>: 2μV ~ 10mV; Probe 0.01X, <range>: 20μV ~ 100mV; Probe 0.1X, <range>: 200μV ~ 1V; Probe 1X, <range>: 2mV ~ 10V;...
Page 67
Command Systems RIGOL :CHAN2:FILT OFF Set the digital filter of channel 2 off. :CHAN2:FILT? Return 0. :CHANnel<n>:MEMoryDepth? Command Format: :CHANnel<n>:MEMoryDepth? Function: This command is query the memory depth on channel x. There are three instances: 1) Alternate trigger: 8192 2) Slow scan or ROLL: 0~8192...
Page 68
RIGOL Command Systems Example: :CHAN2:VERN ON Set the fine adjustment function of channel 2 on. :CHAN2:VERN? Return 1. 11. :CHANnel<n>:UNITs Command Format: :CHANnel<n>:UNITs <units> :CHANnel<n>:UNITs? Function: The command sets the unit as VOLTs (V), AMPeres (A), WATTs (W) or UNKNown.
Command Systems RIGOL MEASure Commands MEASure Commands are used for the fundamental measurement operations, and the measurement results are expressed by scientific notation. MEASure Commands include: :MEASure:CLEar :MEASure:PWIDth? :MEASure:VPP? :MEASure:NWIDth? :MEASure:VMAX? :MEASure:PDUTycycle? :MEASure:VMIN? :MEASure:NDUTycycle? ...
Page 70
RIGOL Command Systems :MEASure:CLEar Command Format: :MEASure:CLEar Function: The command clears the current measurement parameters. :MEASure:VPP? Command Format: :MEASure:VPP? [<source>] Function: The command measures the Peak-Peak value of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4.
Page 71
Command Systems RIGOL :MEASure:VMIN? Command Format: :MEASure:VMIN? [<source>] Function: The command measures the minimum of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as -2.640e000, and the unit is V. :MEASure:VAMPlitude? Command Format: :MEASure:VAMPlitude? [<source>]...
Page 72
RIGOL Command Systems :MEASure:VBASe? Command Format: :MEASure:VBASe? [<source>] Function: The command measures the base value of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as -2.640e000, and the unit is V.
Page 73
Command Systems RIGOL 10. :MEASure:OVERshoot? Command Format: :MEASure:OVERshoot? [<source>] Function: The command measures the overshoot value of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as 8.000e003, and the unit is V.
Page 74
RIGOL Command Systems 13. :MEASure:RISetime? Command Format: :MEASure:RISetime? [<source>] Function: The command measures the rise time of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as 4.000e-005, and the unit is s.
Page 75
Command Systems RIGOL 16. :MEASure:PWIDth? Command Format: :MEASure:PWIDth? [<source>] Function: The command measures the positive pulse width of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as 5.000e-004, and the unit is s.
Page 76
RIGOL Command Systems 19. :MEASure:NDUTycycle? Command Format: :MEASure:NDUTycycle? [<source>] Function: The command measures the negative duty cycle of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as 5.000e001, and the unit is %.
Page 77
Command Systems RIGOL 22. :MEASure:PPHAse? Command Format: :MEASure:PPHAse? [<source A>,<source B>] Function: The command measures the phase difference between <sourceA> and <sourceB> relative to the rising edge. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns as <-1.000 e-004, and the unit is s.
Page 78
RIGOL Command Systems Example: :MEAS:TOT ON Set the total measurement function on. :MEAS:TOT? Return 1. 25. :MEASure:SOURce Command Format: :MEASure:SOURce <source> :MEASure:SOURce? Functions: The command selects the measurement channel. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns CH1 or CH2, CH3, CH4.
Page 79
Command Systems RIGOL :MEAS:DELASOUR? Return CH1, CH2. 27. :MEASure:PHAseSOURce Command Format: :MEASure:PHAseSOURce <source>,<source> :MEASure:PHAseSOURce? Functions: The command selects the channel for measuring the phase delay. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Returned Format: The query returns CH1, CH2 or CH1, CH3, CH1, CH4, CH2, CH3, CH2, CH4, CH3, CH4.
Page 80
RIGOL Command Systems This command is lock MEASURE button and forbid user opening Auto Measure. 30. :MEASure? Command Format: :MEASure? Function: This command is query the state of keylock. Returned Format: The query returns Locked or UnLocked. 2-68 Programming Guide for DS1000B Series...
Command Systems RIGOL WAVeform Commands WAVeform Commands are used to read the data and parameters of waveform on the screen. WAVeform Commands include: :WAVeform:FORMat :WAVeform:DATA? :WAVeform:POINts :WAVeform:POINts:MODE :WAVeform:SOURce :WAVeform:PREamble? :WAVeform:YINCrement? :WAVeform:YORigin? :WAVeform:XINCrement? ...
Page 82
RIGOL Command Systems :WAVeform:FORMat Command Format: :WAVeform:FORMat <value> :WAVeform:FORMat? Function: The command sets the format of waveform data. The <value> may be WORD, BYTE or ASCii. Difference of WORD, BYTE and ASCii: ASCii: Returns ASCII values when data ware transformed into character.
Page 83
Command Systems RIGOL only NORMal and MAXimum mode is available and the system is in STOP state. 600 points are returned in common operation(+, -, ×)while 500 points are returned in FFT operation in all modes (NORMal, RAW, MAXimum).
RIGOL Command Systems For details about storage format of waveform points, please refer to Page 2-76: Peak Detect :WAVeform:POINts:MODE Command Format: :WAVeform:POINts:MODE <points_mode> :WAVeform:POINts:MODE? Function: This command sets the mode of waveform points. <points_mode> can be: NORMal, MAXimum or RAW.
Page 85
Command Systems RIGOL :WAVeform:SOURce Command Format: :WAVeform:SOURce <source> :WAVeform:SOURce? Function: The command sets the source of waveform data which is going to check. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Returned Format: The query returns Channel1 or Channel2, Channel3, Channel4, MATH.
Page 86
RIGOL Command Systems Yor: vertical offset relative to YREF; Yref: Y reference, the middle point of the screen. Example: +1,+0,0,+1,8.000e-009,-6.000e-006,+0,4.000e-002,0.000e000,+100 :WAVeform:YINCrement? Command Format: :WAVeform:YINCrement? [<source>] Function: This command queries the Y unit voltage of the specified source. <source> can be: CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH.
Page 87
Command Systems RIGOL :WAVeform:XINCrement? Command Format: :WAVeform:XINCrement? [<source>] Function: The command queries the interval time between two points of the specified source. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Returned Format: The query returns the value of interval, and the unit is s.
Page 88
RIGOL Command Systems Function: The command queries the horizontal reference axis. Returned Format: The query returns the value of reference axis. Example: :WAV:XREF? Return 0. 12. :WAVeform:YREFerence? Command Format: :WAVeform:YREFrence? Function: The command queries the vertical reference axis. YREFrence is fixed at the verticel middle of the screen (100).
Page 89
Command Systems RIGOL Peak Detect Conditions (1) The Peak Detect acquisition mode is open (2) Time base is greater than 1 us The acquisition is not Peak Detect in other conditions. Data storage format in memory under Peak Detect The waveform data in Peak Detect mode are stored in the form of max1-min1, max2-min2, max3-min3.
Page 90
RIGOL Command Systems contains two waveform points (2) Time(ind) = TimeSpan + TimeOffset Example: When sample rate is 250k Sa/s and trigger offset is 500 us. To calculate time of index point 2: TimeSpan = (2 – 4096)/(250*2) = -8.188ms Time(2) = (-8.188+0.5) = -7.688ms...
Command Systems RIGOL KEY Commands KEY Commands are used to control the keys and knobs on the operation panel of DS1000B. KEY Commands include: :KEY:LOCK :KEY:CH1_VOLT_INC :KEY:STORage :KEY:CH1_VOLT_DEC :KEY:UTILity :KEY:CH1_VOLT_Z :KEY:MEASure :KEY:CH1_POS_INC ...
Page 92
RIGOL Command Systems :KEY:FUNC_Z :KEY:TRIG_LEVEL_INC :KEY:FUNC_INC :KEY:TRIG_LEVEL_DEC :KEY:FUNC_DEC :KEY:TRIG_LEVEL_Z We will give detailed introductions for each command in the following parts. 2-80 Programming Guide for DS1000B Series...
Page 93
Command Systems RIGOL :KEY:LOCK Command Format: :KEY:LOCK { ENABle | DISable } :KEY:LOCK? Function: The command enables and disables the function of Remote control on the keys of front panel. Returned Format: The query returns ENABLE or DISABLE. Example: :KEY:LOCK ENAB Enable remote control on the keys of front panel .
Page 94
RIGOL Command Systems Function: The command sets measurement function and its menu on or off. :KEY:CURSor Command Format: :KEY:CURSor Function: The command enables cursor measurement function and its menu. The cursor mode can be set by sending the command continually.
Page 95
Command Systems RIGOL :KEY:QUICKMEASure Command Format: :KEY:QUICKMEASure Function: The command sets quick-measurement function on or off. And it could be set in Measurement menu. 10. :KEY:QUICKPRINt Command Format: :KEY:QUICKPRINt Function: The command prints and saves the screen. 11. :KEY:AUTO Command Format:...
Page 96
RIGOL Command Systems Command Format: :KEY:SINGLe Function: The command sets the trigger mode as Single trigger. 14. :KEY:MNUTIME Command Format: :KEY:MNUTIME Function: The command sets horizontal system and its menu on or off. 15. :KEY:MNUoff Command Format: :KEY:MNUoff Function: The command sets menu display function on or off.
Page 97
Command Systems RIGOL Function: The command selects the second option in current menu. If the subordinate menu existing and its options are available, then these options could be selected circularly when send repeatly the command. 18. :KEY:F3 Command Format: :KEY:F3 Function: The command selects the third option in current menu.
Page 98
RIGOL Command Systems 21. :KEY:CH1 Command Format: :KEY:CH1 Function: The command sets channel 1 and its menu on or off. 22. :KEY:CH2 Command Format: :KEY:CH2 Function: The command sets channel 2 and its menu on or off. 23. :KEY:CH3 Command Format:...
Page 99
Command Systems RIGOL Function: The command sets Math function and its menu on or off. 26. :KEY:REF Command Format: :KEY:REF Function: The command sets reference waveform function and its menu on or off. 27. :KEY:TrigMODE Command Format: :KEY:TrigMODE Function: The command shifts the trigger mode among AUTO, NORMAL and SINGLE.
Page 100
RIGOL Command Systems 30. :KEY:Trig%50 Command Format: :KEY:Trig%50 Function: This command sets the trigger level at the vertical midpoint of the amplitude of trigger signal. 31. :KEY:FUNC_Z Command Format: :KEY:FUNC_Z Function: The command selects the multifunction knob. 32. :KEY:FUNC_INC Command Format:...
Page 101
Command Systems RIGOL :KEY:CH1_VOLT_INC Function: The command decreases the vertical scale of channel 1. 35. :KEY:CH1_VOLT_DEC Command Format: :KEY:CH1_VOLT_DEC Function: The command increases the vertical scale of channel 1. 36. :KEY:CH1_VOLT_Z Command Format: :KEY:CH1_VOLT_Z Function: The command sets the adjustment mode of vertical scale of channel 1 as Fine or Coarse.
Page 102
RIGOL Command Systems The command decreases the vertical offset of channel 1 evenly. 39. :KEY:CH1_POS_Z Command Format: :KEY: CH1_POS_Z Function: The command adjusts the vertical offset of channel 1 to zero. 40. :KEY:CH2_VOLT_INC Command Format: :KEY:CH2_VOLT_INC Function: The command decreases the vertical scale of channel 2.
Page 103
Command Systems RIGOL 43. :KEY:CH2_POS_INC Command Format: :KEY:CH2_POS_INC Function: The command increases the vertical position of channel 2 evenly. 44. :KEY:CH2_POS_DEC Command Format: :KEY:CH2_POS_DEC Function: The command decreases the vertical position of channel 2 evenly. 45. :KEY:CH2_POS_Z Command Format: :KEY:CH2_POS_Z Function: The command adjusts the vertical offset of channel 2 to zero.
Page 104
RIGOL Command Systems Function: The command increases the vertical scale of channel 3. 48. :KEY:CH3_VOLT_Z Command Format: :KEY:CH3_VOLT_Z Function: The command sets the adjustment mode of vertical scaling of channel 3 as Fine or Coarse. The vertical scale steps by 1-2-5 in Coarse; and by equality in Fine.
Page 105
Command Systems RIGOL 52. :KEY:CH4_VOLT_INC Command Format: :KEY:CH4_VOLT_INC Function: The command decreases the vertical scale of channel 4. 53. :KEY:CH4_VOLT_DEC Command Format: :KEY:CH4_VOLT_DEC Function: The command increases the vertical scale of channel 4. 54. :KEY:CH4_VLOT_Z Command Format: :KEY:CH4_VOLT_Z Function: The command sets the adjustment mode of vertical scale of channel 4 as Fine or Coarse.
Page 106
RIGOL Command Systems :KEY:CH4_POS_DEC Function: The command decreases the vertical offset of channel 4 evenly. 57. :KEY:CH4_POS_Z Command Format: :KEY:CH4_POS_Z Function: The command adjusts the vertical offset of channel 4 to zero. 58. :KEY:TIME_INC Command Format: :KEY:TIME_INC Function: The command decreases the time base by 1-2-5 step.
Page 107
Command Systems RIGOL 61. :KEY:TIME_POS_INC Command Format: :KEY:TIME_POS_INC Function: The command decreases the trigger offset to the horizontal zero point evenly. 62. :KEY:TIME_POS_DEC Command Format: :KEY:TIME_POS_DEC Function: The command increases the trigger offset to the horizontal zero point evenly. 63. :KEY:TIME_POS_Z...
Page 108
RIGOL Command Systems Function: The command decreases the trigger level evenly. 66. :KEY:TRIG_LEVEL_Z Command Format: :KEY:TRIG_LEVEL_Z Function: The command adjusts the trigger level to zero. 2-96 Programming Guide for DS1000B Series...
Command Systems RIGOL SAVe/RECall Commands SAVe/RECall Commands are used to save and recall the waveform data and image on the screen. SAVe/RECall Commands include: :SAVERECALL:TYPE :SAVERECALL:LOCation :SAVERECALL:LOAD :SAVERECALL:SAVe :SAVe:IMAGe:STARt :SAVe:IMAGe:FACTors :SAVe:IMAGe:FORMat :SAVe:WAVeform:STARt ...
Page 110
RIGOL Command Systems :SAVERECALL:TYPE Command Format: :SAVERECALL:TYPE <type> :SAVERECALL:TYPE? Function: The command sets the data type for storage. The <type> may be WAVeform (waveform data) or SETups (data settings). Returned Format: The query returns WAVEFORMS or SETUPS. Example: :SAVERECALL:TYPE WAV Set the storage type as waveform data.
Page 111
Command Systems RIGOL Function: The command recalls the waveform or setup data from internal flash according to storage type. :SAVERECALL:SAVe Command Format: :SAVERECALL:SAVE Function: The command saves the waveform or setup to internal flash according to storage type. :SAVe:IMAGe:STARt Command Format: :SAVE:IMAGe:STARt <file_spec>...
Page 112
RIGOL Command Systems Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :SAVE:IMAG:FACT ON Save the system parameters. :SAVE:IMAG:FACT? Return 1. :SAVe:IMAGe:FORMat Command Format: :SAVE:IMAGe:FORMat <format> :SAVE:IMAGe:FORMat? Function: The command sets the format of saved image. The <format> may be 24bit real color (BMP|BMP24bit), 8bit bitmap (BMP8bit) or PNG (PNG).
Page 113
Command Systems RIGOL :SAVe:SETup:STARt Command Format: :SAVE:SETup:STARt <file_spec> Function: The command starts the saving setup function. If the waveforms are in internal flash, the <file_spec> is composed of integers among 0~9; if in external storage medium, the <file_spec> will be the file name, which is composed of double quotation marks and ASCII characters, also, the file name length within the double quotation marks must less than 26 characters.
Page 114
RIGOL Command Systems length within the double quotation marks must less than 26 characters. NOTE: The system will add the file format suffix with 4 characters automatically, which are not included in 26 characters. 12. :RECall:SETup:STARt Command Format: :RECAll:SETup:STARt <file_spec>...
Command Systems RIGOL MASK Commands MASK Commands are used to create and modify the rules for pass/fail test function. MASK Commands include: :MASK:CREate :MASK:ENABle :MASK:X :MASK:Y :MASK:SOURce :MASK:OPERate :MASK:OUTPut :MASK:STOPonoutput :MASK:SAVE ...
Page 116
RIGOL Command Systems :MASK:CREate Command Format: :MASK:CREate Function: The command creates the rule of passing test. :MASK:ENABle Command Format: :MASK:ENABle {{1|ON}|{0|OFF}} :MASK:ENABle? Function: The command sets the state of passing test as ON or OFF. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF.
Page 117
Command Systems RIGOL :MASK:X 1 Set the X direction rule as 1div. :MASK:X? Return 1.000e000. :MASK:Y Command Format: :MASK:Y <y> :MASK:Y? Function: The command sets the rule of testing Y direction. The <y> is 0.04div~4div. Returned Format: The query returns the y value, and the unit is div.
Page 118
RIGOL Command Systems :MASK:OPERate Command Format: :MASK:OPERate <opt> :MASK:OPERate? Function: The command sets the function of passing test run or stop. The <opt> may be RUN or STOP. Returned Format: The query returns RUN or STOP. Example: :MASK:OPER RUN Set the operation of passing test run.
Page 119
Command Systems RIGOL Command Format: :MASK:STOPonoutput {{1|ON}|{0|OFF}} :MASK:STOPonoutput? Function: The command sets the output stop mode of passing test ON or OFF. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :MASK:STOP ON Set the output stop mode of passing test on.
Page 120
RIGOL Command Systems The command download the test rule to the external storage equipment, and the <filename> is the file name, which is composed of double quotation marks and ASCII characters, also, the file name length within the double quotation marks must less than 26 characters.
Command Systems RIGOL CURSor Commands CURSor Commands are used to set cursor parameters to measure manually and automatically and track the waveform data. CURSor Commands include: :CURSor:MODE :CURSor:MANUal:TYPE :CURSor:MANUal:SOURce :CURSor:MANUal:CURAX :CURSor:MANUal:CURAY :CURSor:MANUal:CURBX :CURSor:MANUal:CURBY ...
Page 122
RIGOL Command Systems :CURSor:MODE Command Format: :CURSor:MODE <mode> :CURSor:MODE? Function: The command sets the cursor mode. The <mode> may be CLOSe, MANUal, TRACk or MEASure (measure automatically). Returned Format: The query returns CLOSE or MANUAL, TRACK, MEASURE. Example: :CURS:MODE TRAC Set the cursor mode as track.
Page 123
Command Systems RIGOL :CURSor:MANUal:SOURce <source> :CURSor:MANUal:SOURce? Function: The command sets the cursor source of manual cursor. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Returned Format: The query returns Channel1 or Channel2, Channel3, Channel4, Math. Example: :CURS:MANU:SOUR CHAN1 Set the cursor source of manual cursor.
Page 124
RIGOL Command Systems Function: The command sets the AY position of manual cursor. The <value> range is 4~194. Returned Format: The query returns the value of AY position. Example: :CURS:MANU:CURAY 100 Set the AY position of manual cursor as 100.
Page 125
Command Systems RIGOL Query Format: :CURSor:MANUal:CURBY? Returned Format: The query returns the value of BY position. Example: :CURS:MANU:CURBY 100 Set the BY position of manual cursor as 100. :CURS:MANU:CURBY? Return 100. :CURSor:TRACk:SOURceA Command Format: :CURSor:TRACk:SOURceA <source> :CURSor:TRACk:SOURceA? Function: The command sets the signal source A of track cursor. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4, MATH or NONE.
Page 126
RIGOL Command Systems Returned Format: The query returns Channel1 or Channel2, Channel3, Channel4, Math, None. Example: :CURS:TRAC:SOURB CHAN1 Set the signal source B of track cursor. :CURS:TRAC:SOURB? Return Channel1. 10. :CURSor:TRACk:CURA Command Format: :CURSor:TRACk:CURA <value> :CURSor:TRACk:CURA? Function: The command sets the position of track cursor A. The <value> range is 4~297.
Page 127
Command Systems RIGOL :CURS:TRAC:CURB? Return 100. Programming Guide for DS1000B Series 2-115...
RIGOL Command Systems Other Commands The following commands are used to set some additional functions: counter, beeper, system language, real-time clock and the state of AUTO key. Other Commands include: :COUNter:ENABle :BEEP:ENABle :BEEP:ACTion :INFO:LANGuage :RTC ...
Page 129
Command Systems RIGOL :COUNter:ENABle Command Format: :COUNter:ENABle {{1|ON}|{0|OFF}} :COUNter:ENABle? Function: The command sets the counter ON or OFF. Returned Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :COUN:ENAB ON Set the counter on. :COUN:ENAB? Return 1.
Page 130
RIGOL Command Systems Function: The command tests the system beeper. :INFO:LANGuage Command Format: :INFO:LANGuage <cmd_lang> :INFO:LANGuage? Function: The command sets the system language. The <cmd_lang> may be SIMPlifiedchinese, TRADitionalchinese, KORean, JAPanese, ENGLish, FRENch, GERMan, ITALian, RUSSian, PORTuguese or SPANish. Returned Format: The query returns Simplified Chinese or Traditional Chinese, Korean, Japanese, English, German, French, Italian, Russian, Portuguese, Spanish.
Page 131
Command Systems RIGOL Returned Format: The query returns the Year, the Month, the day, the hour, the minutes, and the second. Example: :RTC 2008,8,8,20,08,08 Set the system time as 08, 08, 08, 08, 08, 08pm. :RTC? Return 2008, 8, 8, 20, 8, 8.
Programming Examples RIGOL Chapter 3 Programming Examples This chapter lists some programming examples in the development environments of Visual C++ 6.0, Visual Basic 6.0 and LabVIEW 8.6. All the examples are based on VISA (Virtual Instrument Software Architecture). VISA is an API (Application Programming Interface) used for controlling instruments.
PC. See the figure below. Digital Oscilloscope 100-127V, 45-440Hz 100-240V, 45-65Hz LINE 60W MAX F use: 250V , 2A RIGOL Technologies, Inc. LXI Class C Non Auto-MDIX DEVICE HOST MADE IN CHINA After successful connection, turn on the instrument, a dialog will guide you to install the driver of “USB Test and Measurement Device”...
Programming Examples RIGOL Program in Visual C++ 6.0 Open Visual C++ 6.0, take the following steps: 1. Create a project based on MFC. 2. Choose Project → Settings → C/C++; select “Code Generation” in Category and “Debug Multithreaded DLL” in Use run-time library; click 3.
Page 136
RIGOL Programming Examples 4. Choose Tools → Options → Directories; select “Include files” in Show directories for, and then dblclick the blank in Directories to add the path of “Include”: C:\Program Files\IVI Foundation\VISA\WinNT\include. Select “Library files” in Show directories for, and then dblclick the blank in Directories to add the path of “Lib”:...
Page 137
Programming Examples RIGOL 6. Modify the properties of the controls. Name the Text to be “Command”. Choose Data in the property of Com box, input three commands manually: *IDN? *OPC? :ACQuire:TYPE? Choose General in the property of Edit and select Disable.
Page 138
RIGOL Programming Examples 8. Add the codes. Dblclick the Button, enter the programming environment. First of all, declare “#include <visa.h>” in header file, then add the following codes: ViSession defaultRM, vi; char buf [256] = {0}; CString s,strTemp; char* stringTemp;...
RIGOL Programming Examples Program in Visual Basic 6.0 Open Visual Basic 6.0, take the following steps: 1. Create a Standard EXE project. 2. Choose Project→Add Module→Existing; find the “visa.bas” file in the filefolder of include under the path of NI-VISA and add;...
Page 141
Programming Examples RIGOL 5. Dblclick CH1 button to enter the programming environment, add the following codes to achieve the control to it. (for CH2, CH3 and CH4, the methods are similar) Dim defrm As Long Dim vi As Long Dim strRes As String * 200...
RIGOL Programming Examples Program in LabVIEW 8.6 Open LabVIEW 8.6, take the following steps: 1. Open Block Diagram; choose Instrument I/O→VISA; then separately add four functions: “VISA Open”, “VISA Read”, “VISA Write” and “VISA Close”. See the figure below. 2. Move the mouse to the item of “VISA resource name” on the control of “VISA Open”;...
Page 143
Programming Examples RIGOL 3. Separately connect “VISA resource name” with “VISA resource name out” and “error out” with “error in” of all the functions. See the figure below. 4. Add a textbox written with “:WAV:FORM\sBYTE\n” to “write buffer” on one of the “VISA Write” control, and “:WAV:DATA?\n” on the other one.
Page 144
RIGOL Programming Examples String/Array/Path and select “String To Byte Array”; then, use this function to connect “read buffer” on “VISA Read” function with the Waveform Graph. See the figure below. 7. Add an Event Structure and a While Loop as well as two buttons, one of the buttons is used to control the start of waveform fetching, and the other one is to stop capturing.
Page 145
Programming Examples RIGOL After you set the “Start” event, see the result below. 9. Add a While Loop; add “Boolean”→“True Constant” to point the event of Programming Guide for DS1000B Series 3-13...
Page 146
RIGOL Programming Examples the “Stop” button to While and exit. 10. Change the input tunnel of VISA resource name and errors into “Shift Register” to finish creating program. 11. Adjust the style of Front Panel and click “Fetch Waveform” to get following interface.
Page 147
Programming Examples RIGOL Programming Guide for DS1000B Series 3-15...
Need help?
Do you have a question about the DS1204B and is the answer not in the manual?
Questions and answers