Page 3
Information in this publication replaces all previously corresponding material. RIGOL Technologies, Inc. reserves the right to modify or change part of or all the specifications and pricing policies at company’s sole decision. NOTE: RIGOL is registered trademark of RIGOL Technologies, Inc.
RIGOL Chapter 1 Programming Introduction This book provides guidance to the remote control programming of the DS1000B series digital oscilloscopes. It includes the necessary conceptual information, the command structure for the subsystems and the application cases. Users can carry out the remote control to the oscilloscope or do the further development according to this manual.
RIGOL Communication Ports Computers can communicate with the oscilloscope by sending and receiving messages over USB and LAN interface. Commands in the form of ASCII character strings are embedded in your computer to make control easier. The input commands of the host language are used to read responses from the oscilloscope.
RIGOL Symbol Instruction Command Sperator : Commands usually begin with a colon (:), in special case, such as IEEE commands will begin with (*), it represents operations the oscilloscope will take. Queries are formed by adding a question mark (?) at the end of the commands.
RIGOL Command Abbreviation Owing to some of the commands are too long to memory and spell, the commands system of DS1000B especially setup the Commands Abbreviation in order to reduce your workload and the difficulty to memory. The abbreviation rule is all the small letters in the command header are omitted.
RIGOL System Commands System Commands are used for the basic operations of an oscilloscope. They can not only be used as an individual command but also in conjunction with other commands to form instructions. System Commands include: *IDN? :RUN ...
Page 11
The command queries the company name, the oscilloscope model, the product serial and the software version. Return Format: Company name,, <model>, <serial>, <version>. Example: *IDN? Return Rigol Technologies, DS1204B, DS10000000, 00.02.04. :RUN Command Format: :RUN Function: Execute this command, the oscilloscope will start waveform sampling working ,if to stop working, execute :STOP command again.
Page 12
RIGOL Function: The command makes the oscilloscope tests all input waveforms and set the waveforms automatically to get the optimum conditions to display. :FORCetrig Command Format: :FORCetrig Function: The command wil produce a trigger signal to force the oscilloscope trigger and to display a waveform when there is no suitable trigger condition.
Page 13
RIGOL *OPC? Command Format: *OPC? Function: The command queries whether the command operation has been completed. Return Format: The query returns 0 or 1. 1 means operation has been completed, 0 means not. 10. :SINGLE 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.
RIGOL Keyboard Commands Keyboard Commands are used to control the keys and knobs on the operation panel of DS1000B. Keyboard Commands include: :KEY:LOCK :KEY:FUNC_Z :KEY:RUN :KEY:FUNC_INC :KEY:AUTO :KEY:FUNC_DEC :KEY:SINGLe :KEY:CH1_VOLT_INC :KEY:CH1 :KEY:CH1_VOLT_DEC ...
Page 16
RIGOL :KEY:LOCK Command Format: :KEY:LOCK□{ ENABle | DISable } Function: The command enables and disables the function of Remote control on the keys of front panel. Query Format: :KEY:LOCK? Return Format: The query returns ENABLE or DISABLE. Example: :KEY:LOCK□ENABle Enable remote control on the keys of front panel .
Page 17
RIGOL Function: The command sets the trigger mode as Single trigger. :KEY:CH1 Command Format: :KEY:CH1 Function: The command sets channel 1 and its menu on or off. :KEY:CH2 Command Format: :KEY:CH2 Function: The command sets channel 2 and its menu on or off.
Page 18
RIGOL Function: The command sets Math function amd its menu on or off. 10. :KEY:REF Command Format: :KEY:REF Function: The command sets reference waveform function and its menu on or off. 11. :KEY:F1 Command Format: :KEY:F1 Function: The command selects the first 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.
Page 19
RIGOL 14. :KEY:F4 Command Format: :KEY:F4 Function: The command selects the fourth 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 15. :KEY:F5...
Page 20
RIGOL Function: The command sets cursor measurement function and its menu on or off. The cursor mode can be set by sending the command continually. 19. :KEY:ACQuire Command Format: :KEY:ACQuire Function: The command sets acquire menu on or off. 20. :KEY:DISPlay...
Page 21
RIGOL Function: The command sets horizontal system and its menu on or off. 24. :KEY:TrigMENU Command Format: :KEY:TrigMENU Function: The command sets trigger menu on or off. 25. :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.
Page 22
RIGOL Function: The command sets the bulit-in help system on or off. 29. :KEY:QUICKMEASure Command Format: :KEY:QUICKMEASure Function: The command sets quick-measurement function on or off. And it could be set in Measurement menu. 30. :KEY:QUICKPRINt Command Format: :KEY:QUICKPRINt Function: The command prints and saves the screen.
Page 23
RIGOL Function: The command decreases the offset of multifunction knob. 34. :KEY:CH1_VOLT_INC Command Format: :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.
Page 24
RIGOL Function: 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 25
RIGOL 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 26
RIGOL 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. 49. :KEY:CH3_POS_INC Command Format: :KEY:CH3_POS_INC Function: The command increases the vertical offset of channel 3 evenly.
Page 27
RIGOL 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. The vertical scale steps by 1-2-5 in Coarse; and by equality in Fine.
Page 28
RIGOL Function: The command decreases the time base by 1-2-5 step. 59. :KEY:TIME_DEC Command Format: :KEY:TIME_DEC Function: The command increases time base by 1-2-5 step. 60. :KEY:TIME_Z Command Format: :KEY:TIME_Z Function: The command sets delayed scan function on or off.
Page 29
RIGOL Function: The command adjusts the trigger offset to the horizontal zero point evenly. 64. :KEY:TRIG_LEVEL_INC Command Format: :KEY:TRIG_LEVEL_INC Function: The command increases the trigger level evenly. 65. :KEY:TRIG_LEVEL_DEC Command Format: :KEY:TRIG_LEVEL_DEC Function: The command decreases the trigger level evenly.
RIGOL Measurement Commands Measurement Commands are used for the fundamental measurement operations, and the measurement results are expressed by scientific notation. Measurement Commands include: :MEASure:CLEar :MEASure:VPP? :MEASure:VMAX? :MEASure:VMIN? :MEASure:VAMPlitude? :MEASure:VTOP? :MEASure:VBASe? :MEASure:VAVerage? ...
Page 31
RIGOL :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. NOTE: “<>” in <source> indicates the source is the paramter that must be set in the commond;...
Page 32
RIGOL Function: The command measures the minimum of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns -2.640e000, and the unit is V. :MEASure:VAMPlitude? Command Format: :MEASure:VAMPlitude?□[<source>] Function: The command measures the amplitude of signal from <source>. The <source>...
Page 33
RIGOL Return Format: The query returns -2.640e000, and the unit is V. :MEASure:VAVerage? Command Format: :MEASure:VAVerage?□[<source>] Function: The command measures the average value of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns -4.200e-003, and the unit is V.
Page 34
RIGOL 11. :MEASure:PREShoot? Command Format: :MEASure:PREShoot?□[<source>] Function: The command measures the preshoot value of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns 8.000e-003, and the unit is V. 12. :MEASure:FREQuency? Command Format: :MEASure:FREQuency?□[<source>]...
Page 35
RIGOL Function: The command measures the fall time of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns 4.000e-005, and the unit is s. 15. :MEASure:PERiod? Command Format: :MEASure:PERiod?□[<source>] Function: The command measures the period of signal from <source>. The <source>...
Page 36
RIGOL Return Format: The query returns 5.000e-004, and the unit is s. 18. :MEASure:PDUTycycle? Command Format: :MEASure:PDUTycycle?□[<source>] Function: The command measures the positive duty cycle of signal from <source>. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns 5.000e001, and the unit is %.
Page 37
RIGOL 21. :MEASure:NDELay? Command Format: :MEASure:NDELay?□[<source A>,<source B>] Function: The command measures the delay between <sourceA> and <sourceB> relative to the falling edge. The <source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Return Format: The query returns <-1.000 e-004, and the unit is s.
Page 38
RIGOL 24. :MEASure:TOTal Command Format: :MEASure:TOTal□{{1|ON}|{0|OFF}} Function: The command sets all the measurement functions on or off. Query Format: :MEASure:TOTal? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :MEASure:TOTal□ON Set the total measurement function on.
Page 39
RIGOL Command Format: :MEASure:DELAYSOURce□<source>,<source> Functions: The command selects the channel for measuring the time delay. The< source> may be CHANnel1, CHANnel2, CHANnel3 or CHANnel4. Query Format: :MEASure:DELAYSOURce? Return Format: The query returns CH1, CH2 or CH1, CH3, CH1, CH4, CH2, CH3, CH2, CH4, CH3, CH4.
Page 40
RIGOL 28. :MEASure:ENABle Command Format: :MEASure:ENAble Functions: This command is open the locked MEASURE button and allow user to open Auto Measure. NOTE: Only corresponding unlock command can open AUTO and Auto Measure once they are locked, neither restart nor update is available.
RIGOL Acquire Commands Acquire Commands are used to set the acquisition mode for oscilloscope. Acquire Commands include: :ACQuire:TYPE :ACQuire:MODE :ACQuire:AVERages :ACQuire:SRATe? Programming Guide for DS1000B Series 2-33...
Page 42
RIGOL :ACQuire:TYPE Command Format: :ACQuire:TYPE□<type> Function: The command sets the acquisition type. The <type>may be NORMal(common sample), AVERage(average sample) or PEAKdetect(peak detection). Query Format: :ACQuire:TYPE? Return Format: The query returns Normal or AVERAGE, PEAKDETECT. Example: :ACQuire:TYPE□AVERage Set the acquisition type as average acquisition.
Page 43
RIGOL :ACQuire:AVERages Command Format: :ACQuire:AVERages□<count> Function: The command sets the average acquisition time. The <count> range is 2~256, and the count increases by the multiples of 2. Query Format: :ACQuire:AVERages? Return Format: The query returns 2 or 4, 8, 16, 32, 64, 128, 256.
RIGOL Display Commands Diaplay 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? Programming Guide for DS1000B Series...
Page 45
RIGOL :DISPlay:TYPE Command Format: :DISPlay:TYPE□<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). Query Format: :DISPlay:TYPE? Return Format: The query returns VECTORS or DOTS.
Page 46
RIGOL :DISPlay:PERSist Command Format: :DISPlay:PERSist□{{1|ON }|{0|OFF}} 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). Query Format:...
Page 47
RIGOL :DISPlay:MNUStatus Command Format: :DISPlay:MNUStatus□{{1|ON}|{0| OFF}} Function: The command sets menu display function ON (Performing menu operation) or OFF (viewing the waveform). Query Format: :DISPlay:MNUStaus? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :DISPlay:MNUStatus□ON Set menu display function on.
Page 48
RIGOL Function: The command clears the last waveform on the screen. :DISPlay:BRIGhtness Command Format: :DISPlay:BRIGhtness□<count> 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. Query Format:...
Page 49
RIGOL 10. :DISPlay:DATA? Command Format: :DISPlay:DATA? Function: The command queries image data on the current screen, and the data format accords with IEEE488.2 standard. The data structure is: #800078788+the data of 8 bit bitmap. Programming Guide for DS1000B Series 2-41...
RIGOL Vertical Commands Vertical Commands are used to set the vertical system from every channel separately. Vertical 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>:UNITs :CHANnel<n>:VERNier ...
Page 51
RIGOL :CHANnel<n>:BWLimit Command Format: :CHANnel<n>:BWLimit□{{1|ON}|{0|OFF}} 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. Query Format: :CHANnel<n>:BWLimit? Return Format: The query returns 1 or 0, respectively indicates ON or OFF.
Page 52
RIGOL :CHANnel<n>:DISPlay Command Format: :CHANnel<n>:DISPlay□{{1|ON}|{0|OFF}} Function: The command sets the channel ON or OFF. The <n> may be 1, 2, 3 or 4. Query Format: :CHANnel<n>:DISPlay? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Examples: :CHANnel2:DISPlay□ON...
Page 53
RIGOL Function: The command sets the vertical offset. The <n> may be 1, 2, 3 or 4. Scale >200mV, <offset>: -40V~ +40V; Scale ≤200mV, <offset>: -2V ~ +2V. Query Format: :CHANnel<n>:OFFSet? Return Format: The query returns the value of offset, and the unit is V.
Page 54
RIGOL Function: 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 55
RIGOL Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :CHANnel2:FILTer□OFF Set the digital filter of channel 2 off. :CHANnel2:FILTer? 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...
Page 56
RIGOL Example: :CHANnel1:UNITs VOLTs Set the unit of channel 1 as V. :CHANnel1:UNITs? Return VOLTs. 11. :CHANnel<n>:VERNier Command Format: :CHANnel<n>:VERNier□{{1|ON}|{0|OFF}} Function: The command sets the adjustment mode of vertical scale as ON (Fine) or OFF (Coarse). The vertical scale steps by 1-2-5 in Coarse mode; and by equality in Fine mode.The <n>...
RIGOL Horizontal Commands Horizontal 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. Horizontal Commands include: :TIMebase:MODE ...
Page 58
RIGOL :TIMebase:MODE Command Format: :TIMebase:MODE□<mode> Function: The command sets the scan mode of horizontal timebase as MAIN (main time base) or DELayed (delayed scan time base). Query Format: :TIMebase:MODE? Return Format: The query returns MAIN or DELAYED. Example: :TIMebase:MODE□MAIN Set the scan mode as main time base.
Page 59
When the “Delayed” is “ON”, for view waveform details, the waveform may be amplified under the width of window vary with the delayed timebase scale. In NoRMAL mode, different types of instruments have different sweep ranges: DS1204B instrument,<scale_val> range:1ns/div~50s/div. DS1104B instrument,<scale_val>range:2ns/div~50s/div. DS1064B instrument,<scale_val>range:5ns/div~50s/div. In SCAN mode, <scale_val>range: 50ms ~ 50s.
Page 60
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 instrument,<scale_val> range:1ns/div~50s/div. DS1104B instrument,<scale_val>range:2ns/div~50s/div. DS1064B instrument,<scale_val>range:5ns/div~50s/div. In SCAN mode, <scale_val>range: 50ms ~ 50s.
Page 61
RIGOL Query Format: :TIMebase[:MAIN]:SCALe? Return Format: The query returns the value of timebase scale, and the unit is s. Example: :TIMebase:MODE□MAIN Set the scan mode as main. :TIMebase:SCALe□2 Set the timebase scale as 2s. :TIMebase:SCALe? Return 2.000e+00. :TIMebase:FORMat Command Format: :TIMebase:FORMat□<vlaue>...
RIGOL Trigger Commands Trigger Control 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.
Page 63
RIGOL :TRIGger:MODE Command Format: :TRIGger:MODE□<mode> Function: The command sets the trigger mode as Edge, Pulse, Video, Alternation or Pattern trigger. Query Format: :TRIGger:MODE? Return Format: The query returns EDGE or PULSE, VIDEO, ALTERNATION, PATTERN. Example: :TRIGger:MODE□EDGE Set the trigger mode as edge trigger.
Page 64
RIGOL Example: :TRIGGER:EDGE:SOURce□CHANnel1 Set the edge trigger source as channel 1. :TRIGGER:EDGE:SOURce? Return CH1. :TRIGger<mode>:LEVel Command Format: :TRIGger<mode>:LEVel□<level> Function: The command sets the voltage level of Edge, Pulse or Video trigger. The <mode> may be :EDGE, :PULSe or :VIDEO or PATTern.
Page 65
RIGOL Query Format: :TRIGger<mode>:SWEep? Return Format: The query returns AUTO or NORMAL, SINGLE. Example: :TRIGger:EDGE :SWEep□AUTO Set the trigger type as AUTO. :TRIGger:EDGE :SWEep? Return AUTO. :TRIGger:COUPling Command Format: :TRIGger:COUPling□{ DC | AC | LF } Function: The command sets the coupling mode.
Page 66
RIGOL oscilloscope will not trigger until Holdoff ends. The <count> range is 100ns~1.5s. Query Format: :TRIGger:HOLDoff? Return Format: The query returns the value of holdoff time, and the unit is s. Example: :TRIGger:HOLDoff□0.0001 Set the holdoff time as 100μs. :TRIGger:HOLDoff? Return 1.000e-04.
Page 67
RIGOL Example: :TRIGger:SENSitivity□0.2 Set the trigger sensitivity as 0.2div. :TRIGger:SENSitivity? Return 2.00e-01. :TRIGger:HFREject Command Format: :TRIGger:HFREject□{{1|ON}|{0|OFF}} Function: The command sets high frequency reject function on or off. Query Format: :TRIGger:HFREject? Return Format: The query returns 1 or 0, respectively indicates ON or OFF.
Page 69
RIGOL Edge Trigger Edge trigger occurs when the trigger input meets a specified level along the specified slope direction. (1) :TRIGger:EDGE:SLOPe Command Format: :TRIGger:EDGE:SLOPe□{ POSitive | NEGative | ALTernation } Function: The command sets the trigger edge as Positive (rising edge), Negative (falling edge) or ALTernation (rising and falling edge).
Page 70
RIGOL Pulse Trigger Setup a certain trigger condition to capture specified pulse. Pulse tigger occurs when pulse width meets the condition. (1) :TRIGger:PULSe:MODE Command Format: :TRIGger:PULSe:MODE□<mod> Function: The command sets the trigger condition as +Greaterthan (positive pulse width greater than), +Lessthan (positive pulse width less than), + Equal (positive pulse width equal), -Greaterthan (negative pulse width greater than), -Lessthan (negative pulse width less than) or –Equal (negative pulse...
Page 71
RIGOL Example: :TRIGger:PULSe:WIDTh□0.001 Set the pulse width as 1ms. :TRIGger:PULSe:WIDTh? Return 1.000e-03. Programming Guide for DS1000B Series 2-63...
Page 72
RIGOL Video Trigger In video trigger, the standard video signal (NTSC, PAL/SECAM) is triggered in field or line. The trigger coupling mode is DC. (1) :TRIGger:VIDEO:MODE Command Format: :TRIGger:VIDEO:MODE□<mode> Function: The command sets the trigger sync mode as ODDFIELD, EVENFIELD, LINE or ALLLINES.
Page 73
RIGOL :TRIGger:VIDEO:POLarity□POSitive Set the video polarity as positive. :TRIGger:VIDEO:POLarity? Return POSITIVE. (3) :TRIGger:VIDEO:STANdard Command Format: :TRIGger:VIDEO:STANdard□{ NTSC | PALSecam } Function: The command sets the video standard as NTSC or PAL/SECAM. Query Format: :TRIGger:VIDEO:STANdard? Return Format: The query returns NTSC or PAL/SECAM.
Page 74
RIGOL Alternation Trigger In alternation trigger, different signals can be triggered at the same time. And the trigger signals are from two vertical channels. Alternation trigger is applicable for viewing two non-relative signals. The trigger mode of two vertical channels can be set as EDGE, PULSe, or VIDEO trigger.
Page 75
RIGOL Return Format: The query returns SOURceA or SOURceB. Example: :TRIGger:ALTernation:SOURce□CH1CH2 Set the alternation channel as CH1CH2. :TRIGger:ALTernation:CURRentSOURce SOURceB Set the current channel as source B. :TRIGger:ALTernation:CURRentSOURce? Return SOURceB. (3) :TRIGger:ALTernation:TYPE Command Format: :TRIGger:ALTernation:TYPE□<value>[,<source>] Function: The command sets the trigger type. The <value> may be EDGE, PULSe or VIDEO, and the <source>...
Page 76
RIGOL In NoRMAL mode, different types of instruments have different sweep ranges: DS1204B instrument,<scale_val> range:1ns/div~50s/div. DS1104B instrument,<scale_val>range:2ns/div~50s/div. DS1064B instrument,<scale_val>range:5ns/div~50s/div. In SCAN mode, <scale_val>range: 50ms ~ 50s. Query Format: :TRIGger:ALTernation:TimeSCALe?□[<source>] Return Format: The query returns the value of time scale, and the unit is s.
Page 77
RIGOL (6) :TRIGger:ALTernation:LEVel Command Format: :TRIGger:ALTernation:LEVel□<value>[,<source>] Function: The command sets the trigger level of current channel. The <value> range <value> range: (- 6*Scale-Offset①) ~(+6*Scale+Offset①).Scale is the current vertical scale, and the unit is V/div. the <source> may be SOURceA or SOURceB, and the source A and B is different according to the current alternation channel.
Page 78
RIGOL Example: :TRIGger:ALTernation:EDGE:SLOPe□POSitive, SOURceB Set the edge type as rising edge. :TRIGger:ALTernation:EDGE:SLOPe?□SOURceB Return POSITIVE. (8) :TRIGger:ALTernation:PULSe:MODE Command Format: :TRIGger:ALTernation:PULSE:MODE□<value>[,<source>] Function: The command sets the trigger condition of pulse trigger. The <value> may be +GREaterthan, +LESSthan, + EQUal, -GREaterthan, -LESSthan or –EQUal.
Page 79
RIGOL Query Format: :TRIGger:ALTernation:PULSe:TIME?□[<source>] Return Format: The query returns the value of pulse width, and the unit is s. Example: :TRIGGER:ALTERNATION:PULSe:TIME□0.002, SOURceB Set the pulse width as 2ms. :TRIGGER:ALTERNATION:PULSeE:TIME?□SOURCeB Return 2.000e-03. (10) :TRIGger:ALTernation:VIDEO:POLarity Command Format: :TRIGger:ALTernation:VIDEO:POLarity□{POSitive | NEGative }[,<source>] Function: The command sets the video polarity as Positive or Negative.
Page 80
RIGOL 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. Query Format: :TRIGger:ALTernation:VIDEO:STANdard?□[<source>] Return Format: The query returns NTSC or PAL/SECAM.
Page 81
RIGOL (13) :TRIGger:ALTernation:HOLDoff Command Format: :TRIGger:ALTernation:HOLDoff□<count>[,<source>] Function: The command sets the holdoff time to trigger the specified source alternately. Holdoff time is the waiting time of oscilloscope before starting a new trigger. During Holdoff, oscilloscope will not trigger until Holdoff ends.
Page 82
RIGOL Example: :TRIGGER:ALTERNATION:VIDEO:LINE□100, SOURceB Set the specified line number as 100. :TRIGger:ALTernation:VIDEO:LINE?□SOURceB Return 100. (15) :TRIGger:ALTernation:COUPling Command Format: :TRIGger:ALTernation:COUPling□{DC | AC | HF | LF}[,<source>] Function: The command sets the coupling mode. DC (Allow all signals pass); AC (Reject DC signals and attenuate AC signals below 10Hz).
Page 83
RIGOL Query Format: :TRIGger:ALTernation:SENSitivity?□[<source>] Return Format: The query returns the value of trigger sensitivity, and the unit is div. Example: :TRIGger:ALTernation:SENSitivity□0.1, SOURceB Set the trigger sensitivity as 01. :TRIGger:ALTernation:SENSitivity?□SOURceB Return 1.00e-01. Programming Guide for DS1000B Series 2-75...
Page 84
RIGOL Pattern Trigger Pattern trigger identifies the trigger conditions by checking the specified code. The code is the logical combination of all the channels, each channel has three logical values: high (H), low (L) and ignore(X). (1) :TRIGger:PATTern:PATTern Command Format: :TRIGger:PATTern:PATTern□<value>,<mask>,<ext source>[,<edge...
RIGOL 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. Math Command includes: :MATH:DISPlay ...
Page 86
RIGOL :MATH:DISPlay Command Format: :MATH:DISPlay□{{1|ON}|{0|OFF}} Function: The command sets Math waveform on or off. Query Format: :MATH:DISPlay? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :MATH:DISPlay□ON Set Math waveform on. :MATH:DISPlay? Return 1. Programming Guide for DS1000B Series...
RIGOL Waveform Commands Waveform Commands are used to read the datum and parameters of waveform on the screen. Waveform Commands include: :WAVeform:DATA? :WAVeform:FORMat :WAVeform:SOURce :WAVeform:WINMemsize? :WAVeform:YINCrement? :WAVeform:YORigin? :WAVeform:XINCrement? :WAVeform:XORigin? :WAVeform:STARtofroll? :WAVeform:ERASeofroll? ...
Page 88
RIGOL :WAVeform:DATA? Command Format: :WAVeform:DATA?□[<source>] Function: The command is used to read the data of waveform on EMS memory. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Return Format: The query returns 1024 waveform datum. Example: :WAVeform:DATA?□CHANnel1 Read the data from CH1, return: 5.240000e+02, 4.760000e+02,…….
Page 89
RIGOL :WAVeform:SOURce Command Format: :WAVeform:SOURce□<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. Query Format: :WAVeform:SOURce? Return Format: The query returns Channel1 or Channel2, Channel3, Channel4, MATH.
Page 90
RIGOL The command queries the vertical scale of specified soucce. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. NOTE: returned value=scale value/25. Return Format: The query returns the value of vertical scale, and the unit is V. Example: :WAVeform:YINCrement?□CHANnel2...
Page 91
RIGOL :WAVeform:XORigin? Command Format: :WAVeform:XORigin?□[<source>] Function: The command queries the time from origin to start of EMS memory of specified soucce. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Return Format: The query returns the value of time and the unit is s.
Page 92
RIGOL Example: :WAVeform:ERASeofroll? Return 3. 11. :WAVeform:WINDowzoom? Command Format: :WAVeform:WINDowzoom? Function: The command queries the window width. Return Format: The query returns the value of window width, and the unit is pels. Example: :WAVeform:WINDowzoom? Return 300. 12. :WAVeform:SYSMemsize? Command Format:...
Page 93
RIGOL Return Format: The query returns the value of screen, and the unit is V. Example: :WAVeform:SCREENDATA?□CHANNEL1 Query the screen data of channel1, return: 4.000000e+02, ……. 14. :WAVeform:MEMorydata? Command Format: :WAVeform:MEMorydata?□[<source>] Function: The command queries the memory data of specified source. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH.
Page 94
RIGOL Function: The command queries the position that the left of screen reaches the start point of memory. Return Format: The query returns the coordinate of position. Example: :WAVeform:WPOSition? Return 1696. 17. :WAVeform:PARAmeter? Command Format: :WAVeform:PARAmeter?<para> Function: The command queries the system draw parameters.
Page 95
RIGOL Function: The command queries the vertical reference axis. Return Format: The query returns the value of reference axis. Example: :WAVeform:YREFerence? Return 99. 20. :WAVeform:DATA? XY <data> Command Format; :WAVeform:DATA? XY <data> Function: Request the waveform in XY mode. 2K, 1K in front is channel1, 1K in back is channel2.
RIGOL Utility Commands Utility Commands are used to set other system function, such as counter, system language, system beep and real-time clock. Utility Commands include: :COUNter:ENABle :BEEP:ENABle :BEEP:ACTion :RTC :INFO:LANGuage Programming Guide for DS1000B Series...
Page 97
RIGOL :COUNter:ENABle Command Format: :COUNter:ENABle□{{1|ON}|{0|OFF}} Function: The command sets the counter ON or OFF. Query Format: :COUNter:ENABle? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :COUNter:ENABle□ON Set the counter on. :COUNter:ENABle? Return 1. :BEEP:ENABle Command Format: :BEEP:ENABle□{{1|ON}|{0|OFF}}...
Page 98
RIGOL Function: The command tests the system beeper. :RTC Command Format: :RTC□<year>,<month>,<day>,<hour>,<minute>,<second> Function: The command sets the system time. Query Format: :RTC? Return Format: The query returns the Year, the Month, the day, the hour, the minite, and the second.
RIGOL Storage Commands Storage Commands are used to save and recall the waveform data and screen image. Storage Commands include: :SAVERECALL:TYPE :SAVERECALL:LOCation :SAVERECALL:LOAD :SAVERECALL:SAVE :SAVE:IMAGe:STARt :SAVE:IMAGe:FACTors :SAVE:IMAGe:FORMat :SAVE:WAVeform:STARt :SAVE:SETup:STARt :SAVE:CSV:STARt ...
Page 100
RIGOL :SAVERECALL:TYPE Command Format: :SAVERECALL:TYPE□<type> Function: The command sets the data type for storage. The <type> may be WAVeform (waveform data) or SETups (data settings). Query Format: :SAVERECALL:TYPE? Return Format: The query returns WAVEFORMS or SETUPS. Example: :SAVERECALL:TYPE□WAVeforms Set the storage type as waveform data.
Page 101
RIGOL Command Format: :SAVERECALL:LOAD 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 102
RIGOL Example: :SAVE:IMAGe:FACTors□ON Save the system parameters. :SAVE:IMAGe:FACTors? Return 1. :SAVE:IMAGe:FORMat Command Format: :SAVE:IMAGe:FORMat□<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). Query Format: :SAVE:IMAGe:FORMat? Return Format: The query returns BMP24bit, BMP8bit or PNG.
Page 103
RIGOL 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> is composed of ASCII characters. 10. :SAVE:CSV:STARt Command Format: :SAVE:CSV:STARt <file_spec>]...
RIGOL Mask Commands Mask Commad 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 :MASK:LOAD ...
Page 105
RIGOL :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}} Function: The command sets the state of passing test as ON or OFF. Query Format: :MASK:ENABle? Return Format: The query returns 1 or 0, respectively indicates ON or OFF.
Page 106
RIGOL Example: :MASK:X□1 Set the X direction rule as 1div. :MASK:X? Return 1.000000. :MASK:Y Command Format: :MASK:Y□<y> Function: The command sets the rule of testing Y direction. The <y> is 0.04div~4div. Query Format: :MASK:Y? Return Format: The query returns the y value, and the unit is div.
Page 107
RIGOL :MASK:OPERate Command Format: :MASK:OPERate□<opt> Function: The command sets the function of passing test run or stop. The <opt> may be RUN or STOP. Query Format: :MASK:OPERate? Return Format: The query returns RUN or STOP. Example: :MASK:OPERate□RUN Set the operation of passing test run.
Page 108
RIGOL :MASK:STOPonoutput Command Format: :MASK:STOPonoutput□{{1|ON}|{0|OFF}} Function: The command sets the output stop mode of passing test ON or OFF. Query Format: :MASK:STOPonoutput? Return Format: The query returns 1 or 0, respectively indicates ON or OFF. Example: :MASK:STOPonoutput□ON Set the output stop mode of passing test on.
Page 109
RIGOL NOTE: In commands, the file name must add double quotation marks. 12. :MASK:Upload Command Format: :MASK:Upload□<filename> Function: The command uploads the test rule from the external storage equipment, and the <filename> must be ASCII character. NOTE: In commands, the file name must add double quotation marks.
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 :CURSor:TRACk:SOURceA ...
Page 111
RIGOL :CURSor:MODE Command Format: :CURSor:MODE□<mode> Function: The command sets the cursor mode. The <mode> may be CLOSe, MANUal, TRACk or MEASure (measure automatically). Query Format: :CURSor:MODE? Return Format: The query returns CLOSE or MANUAL, TRACK, MEASURE. Example: :CURSor:MODE□TRACK Set the cursor mode as track.
Page 112
RIGOL Command Format: :CURSor:MANUal:SOURce□<source> Function: The command sets the cursor source of manual cursor. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4 or MATH. Query Format: :CURSor:MANUal:SOURce? Return Format: The query returns Channel1 or Channel2, Channel3, Channel4, Math. Example: :CURSor:MANUal:SOURce□CHANnel1 Set the curosor source of manual cursor as channel 1.
Page 113
RIGOL Command Format: :CURSor:MANUal:CURAY□<value> Function: The command sets the AY position of manual cursor. The <value> range is 4~194. Query Format: :CURSor:MANUal:CURAY? Return Format: The query returns the value of AY position. Example: :CURSor:MANUal:CURAY□100 Set the AY position of manual cursor as 100.
Page 114
RIGOL Function: The command sets the BY position of manual cursor. The <value> range is 4~194. Query Format: :CURSor:MANUal:CURBY? Return Format: The query returns the value of BY position. Example: :CURSor:MANUal:CURBY□100 Set the BY position of manual cursor as 100.
Page 115
RIGOL Function: The command sets the signal source B of track cursor. The <source> may be CHANnel1, CHANnel2, CHANnel3, CHANnel4, MATH or NONE. Query Format: :CURSor:TRACk:SOURceB? Return Format: The query returns Channel1 or Channel2, Channel3, Channel4, Math, None. Example: :CURSor:TRACk:SOURceB□CHANnel1 Set the signal source B of track cursor as channel 1.
Page 116
RIGOL Query Format: :CURSor:TRACk:CURB? Return Format: The query returns the position of cursor B. Example: :CURSor:TRACk:CURB□100 Set the position of track cursor B as 100. :CURSor:TRACk:CURB? Return 100. Programming Guide for DS1000B Series 2-108...
RIGOL Other Commands There are some other commands except for above commands: clear the system error information, download the system setup data, enable and disable the AUTO key and enable and disable the Measure key. The commands include: :SYSTem:ERRor ...
Page 118
RIGOL :SYSTem:ERRor Command Format: :SYSTem:ERRor Function: The command clears the queue of error information. Query Format: :SYSTem:ERRor? Return Format: If there are errors, return 0, No error; or else return Undefine header. Example: :SYSTem:ERRor? Return 0, No error. :SYSTem:ERRor? Command Format:...
Page 119
RIGOL :SYSTem:SETup? Command Format: :SYSTem:SETup? Function: Return the data of system SETUP. :AUToscale:DISable Command Format: :AUTOscale:DISable Function: The command disables the AUTO key, and forbids users setting automatically. :AUToscale:ENable Command Format: :AUToscale:ENable Function: The command enables the AUTO key, and allows users to set automatically.
RIGOL Chapter 3 Programming Examples This chapter lists some application examples of RIGOL DS1000B commands (C language). Users can compare or refer to them to get further understanding for the usage of commands. The contents between “/*”and “*/” before every command are explanations which intends to help users understand instead of the contents of command.
RIGOL Example 2 Setting the basic measurement /*Save the character string of equipment identifier the *IDN command returned*/ char s8IDNString[256]; void BasicSetup(void) /*Firstly acquire the equipment identifier*/ viQueryf(g_vi,"*IDN?\n","%t",s8IDNString); /*Send the command :AUTO, and the equipment sets automatically according to the current signal to display best*/ viPrintf(g_vi,":AUTO\n");...
RIGOL Example 3 Storaging and Setting the File #define BUFFER_SETUP_SIZE 1636 void SetupUpload() BYTE *bufSetup = new BYTE[BUFFER_SETUP_SIZE]; FILE *fp; /*Judge the buffer validity */ if (bufSetup == NULL) return; /*Make a statement for the VISA status*/ ViStatus sta; /*Send the command :SYSTEM:SETUP? to save the file to buffer*/ sta=viQueryf(g_vi,":SYSTEM:SETUP?\n","%#b\n",BUFFER_SETUP_SIZE,...
Page 125
RIGOL void SetupDownLoad() BYTE *bufSetup = new BYTE[BUFFER_SETUP_SIZE]; FILE *fp; /*Judge the buffer validity */ if (bufSetup == NULL) return; /*Open the setup file*/ fp = fopen("C:\\scope\\setup.dat","rb"); if(fread(bufSetup,sizeof(BYTE),BUFFER_SETUP_SIZE,fp)!=BUFFER_SETUP _SIZE) fclose(fp); return ; fclose(fp); /*Make a statement for VISA 32bit data type*/...
RIGOL Example 4 Reading the Data of Screen Image #define BUFFER_IMAGE_SIZE 320*240+256*4+54+1; void ImageUpload() BYTE *bufImage = new BYTE[BUFFER_IMAGE_SIZE]; FILE *fp; long headLen = 10; long sizeImage = BUFFER_IMAGE_SIZE; /*Judge the buffer validity*/ if (bufImage == NULL) return; /*Make a statement for the VISA status*/ ViStatus staDISP;...
Need help?
Do you have a question about the DS1204B and is the answer not in the manual?
Questions and answers