Summary of Contents for Rigol DS1000E Series, DS1000D Series
Page 1
RIGOL Programming Guide DS1000E, DS1000D Series Digital Oscilloscope July 2009 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.
RIGOL Content Chapter 1 Programming Introduction ........... 1-1 Communication Interfaces ................. 1-2 Command Introduction ................1-3 Command Syntax ................1-3 Symbol Instruction ................1-4 Command Input ................. 1-5 Parameter Type .................. 1-6 Chapter 2 Command Systems ............... 2-1 General Commands ................... 2-2 SYSTem Commands ...................
Page 5
RIGOL Programming based on RIGOL USB Driver ........... 3-2 Program in Visual C++ 6.0 ..............3-2 Program in Visual Basic 6.0 ..............3-7 Programming based on VISA ..............3-16 Program in Visual C++ 6.0 ..............3-16 Program in Visual Basic 6.0 ............... 3-21 Program in LabVIEW 8.6 ..............
Programming Introduction RIGOL Chapter 1 Programming Introduction This chapter provides the introduction about the interfces and commands so as to control DS1000E,DS1000D series digital oscilloscopes via remote commands. The chapter contains following topics: Communication Interfaces Command Introduction Command Syntax...
Programming Introduction RIGOL Communication Interfaces Computers communicate with the oscilloscope by sending and receiving messages over an I/O port such as an USB or RS-232 port. Commands appear as ASCII character strings embedded inside the output statements of a “host” language available on your computer.
Programming Introduction RIGOL Command Introduction Command Syntax The command system of DS1000E, DS1000D series digital oscilloscopes presents a multiscale tree structure, each of the subsystem consists of a “Root” keyword and one or multilayered keywords. Generally, a command line starts with “:” (except for IEEE commands) and “:”...
Programming Introduction RIGOL Symbol Instruction 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 enclosed in a command line must be selected. When several...
Programming Introduction RIGOL Command Input All the commands of both DS1000E, DS1000D series are case-insensitive. You can use capital letter to input the whole command or you can input the abbreviation. Note that if use abbreviation, the capital letters specified in commands must be written completely.
Programming Introduction RIGOL Parameter Type The commands contains 5 kinds of parameters, different parameters have different setting methods. Boolean The parameter should be “OFF” or “ON”, for example: :MEASure:TOTal {ON|OFF} Thereinto, “ON” denotes trun on (enable) this function and “OFF” denoets turn off (disable).
Command Systems RIGOL Chapter 2 Command Systems This chapter gives detailed information on each command supported by DS1000E, DS1000D series, including command format, function description, using considerations as well as some application examples. The subcommands systems contain: General Commands ...
Command Systems RIGOL General Commands IEEE standard defineds common commands for querying or executing some basic information about instrument, which usually begins with “*” and holds 3-character long command keywords. DS1000E, DS1000D series digital oscilloscopes support following IEEE488.2 commands: *IDN? ...
Page 15
The command queries the ID character string of the instrument, including a field separated by 4 commas: manufactory, model, serial number and the version number composed of numbers and separated by “.” . Returned Format: RIGOL TECHNOLOGIES,<model>, <serial number>, <software version number>. Example: RIGOL TECHNOLOGIES,DS1102E,DS1EB104702974,00.02.01.01.00...
Command Systems RIGOL SYSTem Commands SYSTem Commands are the fundamental commands for the operation of an oscilloscope. They can either be used for operational control or screen data interception and more. SYSTem Commands include: :RUN :STOP :AUTO ...
Page 17
Command Systems RIGOL :RUN Command Format: :RUN Function Explanation: The command initiates the oscilloscope to acquire waveform data according to its current settings. Acquisition runs continuously until the oscilloscope receives a :STOP command. :STOP Command Format: :STOP Function Explanation: The command controls the oscilloscope to stop acquiring data. To restart the acquisition, use the :RUN command.
Command Systems RIGOL ACQuire Commands ACQuire Commands set the acquire mode for the oscilloscope, including: :ACQuire:TYPE :ACQuire:MODE :ACQuire:AVERages :ACQuire:SAMPlingrate? :ACQuire:MEMDepth <depth> The detailed information of each command are given as follows: Programming Guide for DS1000E, DS1000D Series...
Page 19
Command Systems RIGOL :ACQuire:TYPE Command Format: :ACQuire:TYPE <type> :ACQuire:TYPE? Function Explanation: The commands set and query the current acquire type of the oscilloscope. <type> could be NORMal, AVERage or PEAKdetect. Returned Format: The query returns NORMAL, AVERAGE or PEAKDETECT. Example: :ACQ:TYPE AVER Setup the acquire type as Average.
Page 20
Command Systems RIGOL :ACQuire:AVERages <count> :ACQuire:AVERages? Function Explanation: The commands set and query the average numbers in Average mode. <count> could be and integer of 2 times the power of N within 2 and 256. Returned Format: The query returns 2, 4, 8, 16, 32, 64, 128 or 256.
Page 21
Command Systems RIGOL The commands set and query the memory depth of the oscilloscope. <depth> could be LONG (long memory) or NORMal (normal memory) Returned Format: The query returns LONG or NORMAL. Example: :ACQ:MEMD LONG Set the memory type as LONG.
Command Systems RIGOL DISPlay Commands DISPlay Commands setup the display type of the oscilloscope. DISPlay Commands include: :DISPlay:TYPE :DISPlay:GRID :DISPlay:PERSist :DISPlay:MNUDisplay :DISPlay:MNUStatus :DISPlay:CLEar :DISPlay:BRIGhtness :DISPlay:INTensity The detailed information of each command are given as follows:...
Page 23
Command Systems RIGOL :DISPlay:TYPE Command Format: :DISPlay:TYPE <type> :DISPlay:TYPE? Function Explanation: The commands set and query the display type between sampling points. <type> could be VECTors ( vectir display) or DOTS (point display). Returned Format: The query returns VECTORS or DOTS.
Page 24
Command Systems RIGOL Command Format: :DISPlay:PERSist {ON|OFF} :DISPlay:PERSist? Function Explanation: The commands set and query the state of the waveform persist. “ON” denotes the record points hold until disable the presist, “OFF” denotes the record point varies in high refresh rate.
Page 25
Command Systems RIGOL :DISPlay:MNUStaus? Function Explanation: The commands set and query the state of the operation menu. Returned Format: The query returns ON or OFF. Example: :DISP:MNUS ON Open menu for current operation. :DISP:MNUS? The query returns ON :DISPlay:CLEar Command Format:...
Page 26
Command Systems RIGOL :DISPlay:INTensity Command Format: :DISPlay:INTensity <count> :DISPlay:INTensity? Function Explanation: The commands set and query the brightness of the waveform. <count> could be the integer between 0 and 32. Returned Format: The query returns the setting value of <count>.
Command Systems RIGOL TIMebase Commands TIMebase Commands set the horizontal scale (time base) and the waveform horizontal position in the memory (trigger offset). The waveform will enlarge or shrink among various horizontal scale. TIMebase Commands include: :TIMebase:MODE :TIMebase[:DELayed]:OFFSet ...
Page 28
Command Systems RIGOL :TIMebase:MODE Command Format: :TIMebase:MODE <mode> :TIMebase:MODE? Function Explanation: The commands set and query the scan mode of horizontal timebase. <mode> could be MAIN (main timebase) or DELayed (delayed scan). Returned Format: The query returns MAIN or DELAYED.
Page 29
Command Systems RIGOL :TIM:OFFS? The query returns 1.000e+00. :TIMebase[:DELayed]:SCALe Command Format: :TIMebase[:DELayed]:SCALe <scale_val> :TIMebase[:DELayed]:SCALe? Function Explanation: The commands set and query the horizontal scale for MAIN or DELayed timebase, the unit is s/div (seconds/grid), thereinto: In YT mode, the range of <scale_val> is 2ns - 50s;...
Page 30
Command Systems RIGOL :TIM:FORM YT Setup the form of grid as YT. :TIM:FORM? The query returns Y-T. Programming Guide for DS1000E, DS1000D Series 2-18...
Command Systems RIGOL TRIGger Commands In order to make the waveform displayed more stable, it is necessary to set the trigger system. The trigger determines when the oscilloscope starts to acquire data and display a waveform. If a trigger is set up properly, it converts unstable displays into meaningful waveforms.
Page 33
Command Systems RIGOL :TRIGger:ALTernation:SLOPe:LEVelA :TRIGger:ALTernation:SLOPe:LEVelB :TRIGger:ALTernation<mode>:COUPling :TRIGger:ALTernation<mode>:HOLDoff :TRIGger:ALTernation<mode>:SENSitivity The detailed information of each command are given as follows: Programming Guide for DS1000E, DS1000D Series 2-21...
Command Systems RIGOL Trigger Control :TRIGger:MODE Command Format: :TRIGger:MODE <mode> :TRIGger:MODE? Function Explanation: The commands set and query the mode of trigger. <mode> could be EDGE, PULSe, VIDEO, SLOPe, PATTern, DURation or ALTernation. Returned Format: The query returns EDGE, PULSE, VIDEO, SLOPE, PATTERN, DURATION or ALTERNATION.
Page 35
Command Systems RIGOL The query returns CH1, CH2, EXT, ACLINE, D0~D15. Example: :TRIG:EDGE:SOUR CHAN1 Setup the soure of edge trigger as CHANnel1. :TRIG:EDGE:SOUR? The query returns CH1. :TRIGger<mode>:LEVel Command Format: :TRIGger<mode>:LEVel <level> :TRIGger<mode>:LEVel? Function Explanation: The commands set and query the trigger level. <level> could be :EDGE, :PULSe or :VIDEO;...
Page 36
Command Systems RIGOL Example: :TRIG:EDGE:SWE AUTO Setup the trigger type as AUTO. :TRIG:EDGE:SWE? The query returns AUTO. :TRIGger<mode>:COUPling Command Format: :TRIGger<mode>:COUPling {DC|AC|HF|LF} :TRIGger<mode>:COUPling? Function Explanation: The commands set and query the coupling type. Thereinto, DC: Allow all signals pass. AC: Block DC signals and attenuate the signals lower than 10Hz.
Page 37
Command Systems RIGOL Example: :TRIG:HOLD 0.0005 Setup the holdoff time as 500ms. :TRIG:HOLDoff? The query returns 5.000e-04 :TRIGger:STATus? Command Format: :TRIGger:STATus? Function Explanation: The command queries the operating status of the oscilloscope. The status could be RUN, STOP, T`D, WAIT or AUTO.
Command Systems RIGOL EDGE Trigger :TRIGger:EDGE:SLOPe Command Format: :TRIGger:EDGE:SLOPe {POSitive|NEGative} :TRIGger:EDGE:SLOPe? Function Explanation: The commands set and query the type of edge trigger. The type could be POSitive (Rising edge) or NEGative (Failing edge). Returned Format: The query returns POSITIVE or NEGATIVE.
Command Systems RIGOL PULSe Trigger :TRIGger:PULSe:MODE Command Format: :TRIGger:PULSe:MODE <mode> :TRIGger:PULSe:MODE? Function Explanation: The commands set and query the pulse condition. <mode> could be +GREaterthan (positive pulse greater than), +LESSthan (positive pulse less than), +EQUal (positive pulse equals to), -GREaterthan (negative pulse greater than), -LESSthan (negative pulse less than) or –EQUal (negative pulse equals...
Page 40
Command Systems RIGOL :TRIG:PULS:SENS 0.5 Setup the sensitive as 0.5div. :TRIG:PULS:SENS? The query returns 5.00e-01. :TRIGger:PULSe:WIDTh Command Format: :TRIGger:PULSe:WIDTh <wid> :TRIGger:PULSe:WIDTh? Function Explanation: The commands set and query the pulse width. The range of <wid> is 20ns ~ 10s. Returned Format: The query returns the setting value of the <wid>...
Command Systems RIGOL VIDEO Trigger :TRIGger:VIDEO:MODE Command Format: :TRIGger:VIDEO:MODE <mode> :TRIGger:VIDEO:MODE? Function Explanation: The commands set and query the synchronous mode of the video trigger. <mode> could be ODDfield, EVENfield, LINE or ALLlines. Returned Format: The query returns ODD FIELD, EVEN FIELD, LINE or ALL LINES.
Page 42
Command Systems RIGOL :TRIGger:VIDEO:STANdard Command Format: :TRIGger:VIDEO:STANdard {NTSC|PALSecam} :TRIGger:VIDEO:STANdard? Function Explanation: The commands set and query the type of video trigger standard. Returned Format: The query returns NTSC or PAL/SECAM. Example: :TRIG:VIDEO:STAN PALS Setup the video standard as PALSecam. :TRIG:VIDEO:STAN? The query returns PAL/SECAM.
Page 43
Command Systems RIGOL :TRIGger:VIDEO:SENSitivity <count> :TRIGger:VIDEO:SENSitivity? Function Explanation: The commands set and query the trigger sensitive, the range of <count> is: 0.1div ~1div. Returned Format: The query returns the setting value of <count> in div. Example: :TRIG:VIDEO:SENS 0.5 Setup the trigger sensitive as 0.5div.
Command Systems RIGOL SLOPe Trigger :TRIGger:SLOPe:TIME Command Format: :TRIGger:SLOPe:TIME <count> :TRIGger:SLOPe:TIME? Function Explanation: The commands set and query the time setting about slope trigger. The range of <count> is 20ns~10s. Returned Format: The query returns the setting value of <count> in s.
Page 45
Command Systems RIGOL :TRIGger:SLOPe:MODE Command Format: :TRIGger:SLOPe:MODE <mode> :TRIGger:SLOPe:MODE? Function Explanation: The commands set and query the slope condition. <mode> could be +GREaterthan (positive slope greater than), +LESSthan (positive slope less than), + EQUal (positive slope equals to), -GREaterthan (negative slope greater than), -LESSthan (negative slope less than) or –EQUal (negative slope equals...
Page 46
Command Systems RIGOL The query returns P_WIN_A, P_WIN_B, P_WIN_AB, N_WIN_A, N_WIN_B or N_WIN_AB. Example: :TRIG:SLOP:WIND PA Setup the type of trigger level as rising edge Level A :TRIG:SLOP:WIND? The query returns P_WIN_A. :TRIGger:SLOPe:LEVelA Command Format: :TRIGger:SLOPe:LEVelA <value> :TRIGger:SLOPe:LEVelA? Function Explanation: The commands set and query the upper boundary “Level A”...
Page 47
Command Systems RIGOL The query returns the setting value of level in V. Note: Level A (upper boundary) can not be less than the maximum of Level B (lower boundary). Example: :TRIG:SLOP:LEVB -1.5 Setup the lower boundary of trigger level as -1.5V.
Command Systems RIGOL PATTern Trigger :TRIGger:PATTern:PATTern Command Format: :TRIGger:PATTern:PATTern <value>,<mask>, [<edge source>,<edge>] :TRIGger:PATTern:PATTern? Function Explanation: The commands set and query the type of pattern for digital signal. Thereinto, When <value> is a 16-bit integer without sign, high is 1, and low is o;...
Command Systems RIGOL DURation Trigger :TRIGger:DURation:PATTern Command Format: :TRIGger:DURation:PATTern <value>,<mask> :TRIGger:DURation:PATTern? Function Explanation:; The commands set and query the type of pattern for digital signal. Thereinto, When <value> is a 16-bit integer without sign, high is 1, and low is o;...
Page 50
Command Systems RIGOL :TRIGger:DURation:QUALifier Command Format: :TRIGger:DURation:QUALifier <qual> :TRIGger:DURation:QUALifier? Function Explanation:; The commands set and query the limiting condition of trigger time. <qual> could be GREaterthan, LESSthan or EQUal. Returned Format: The query returns GREATER THAN, LESS THAN or EQUAL.
Command Systems RIGOL ALTernation Trigger :TRIGger:ALTernation:SOURce Command Format: :TRIGger:ALTernation:SOURce <src> :TRIGger:ALTernation:SOURce? Function Explanation: The commands set and query which channel is to be used. <src> could be CHANnel1 or CHANnel2. Returned Format: The query returns CH1 or CH2. Example: :TRIG:ALT:SOUR CHAN2 Select CHANnel2 as current channel.
Page 52
Command Systems RIGOL :TRIGger:ALTernation:TimeSCALe Command Format: :TRIGger:ALTernation:TimeSCALe <value> :TRIGger:ALTernation:TimeSCALe? Function Explanation: The commands set and query the timebase of the current channel. The range of <value> is: 2ns~20ms. Returned Format: The query returns the setting value of the timebase in s.
Page 53
Command Systems RIGOL :TRIGger:ALTernation<mode>:LEVel Command Format: :TRIGger:ALTernation<mode>:LEVel <value> :TRIGger:ALTernation<mode>:LEVel? Function Explanation: The commands set and query the trigger level of the current channel. <mode> could be :EDGE, :PULSe or :VIDEO. The range of <value> is - 6*Scale ~ + 6*Scale,Scale indicates the current vertical scale, the unit is V/div.
Page 54
Command Systems RIGOL Command Format: :TRIGger:ALTernation<mode>:MODE <value> :TRIGger:ALTernation<mode>:MODE? Function Explanation: The commands set and query the current pulse condition and slope condition or synchronization condition video trigger. <mode> could be :PULSe, :SLOPe or :VIDEO. In PULSe or SLOPe mode, the <value> could be +GREaterthan, +LESSthan, + EQUal, -GREaterthan, -LESSthan or -EQUal;...
Page 55
Command Systems RIGOL :TRIGger:ALTernation:VIDEO:POLarity Command Format: :TRIGger:ALTernation:VIDEO:POLarity {POSitive|NEGative} :TRIGger:ALTernation:VIDEO:POLarity? Function Explanation: The commands set and query the current video polarity. Returned Format: The query returns POSITIVE or NEGATIVE. Example: :TRIG:ALT:VIDEO:POL POS Setup the video polarity as POSITIVE. :TRIG:ALT:VIDEO:POL? The query returns POSITIVE.
Page 56
Command Systems RIGOL Function Explanation: The commands set and query the current number of specified line in synchronous mode. In NTSC standard,the range of <value> is 1~525;In AL/SECAM standard, the range of <value> is 1~625. Returned Format: The query returns the setting value of <value>.
Page 57
Command Systems RIGOL 13. :TRIGger:ALTernation:SLOPe:LEVelA Command Format: :TRIGger:ALTernation:SLOPe:LEVelA <value> :TRIGger:ALTernation:SLOPe:LEVelA? Function Explanation: The commands set and query the current upper boundary “Level A” of trigger level in slope trigger mode. The range of <value> is LevelB ~ +6*Scale; Scale indicates the current vertical scale, the unit is V/div.
Page 58
Command Systems RIGOL :TRIG:ALT:SLOP:LEVB ? The query returns -1.500e+00. 15. :TRIGger:ALTernation<mode>:COUPling Command Format: :TRIGger:ALTernation<mode>:COUPling {DC|AC|HF|LF} :TRIGger:ALTernation<mode>:COUPling? Function Explanation: The commands set and query the coupling mode. Thereinto, DC: Allow all signals pass; AC: Block DC signals and attenuate the signals lower than10Hz;...
Page 59
Command Systems RIGOL :TRIG:ALT:PULS:HOLD 1 Setup the holdoff time as 1s. :TRIG:ALT:PULS:HOLD? The query returns 1.000e+00. 17. :TRIGger:ALTernation<mode>:SENSitivity Command Format: :TRIGger:ALTernation<mode>:SENSitivity <count> :TRIGger:ALTernation<mode>:SLOPe:SENSitivity? Function Explanation:; The commands set and query the trigger sensitive. The <mode> could be :EDGE, :PULSe, :SLOPe or :VIDEO. The range of <count> is 0.1div ~1div.
Command Systems RIGOL STORage Command STORage Command is used for recalling the factory settings, including: :STORage:FACTory:LOAD The detailed information of each command are given as follows: Programming Guide for DS1000E, DS1000D Series 2-48...
Page 61
Command Systems RIGOL :STORage:FACTory:LOAD Command Format: :STORage:FACTory:LOAD Function Explanation: The command recalls the system settings before leaving factory. Programming Guide for DS1000E, DS1000D Series 2-49...
Command Systems RIGOL MATH Commands MATH (math operation) Commands are used for executing the add, reduce, multiply and FFT operations of wavefrom from CH1 and CH2 and display the results. The results are measured by grid or cusor. MATH Commands include: :MATH:DISPlay ...
Page 63
Command Systems RIGOL :MATH:DISPlay Command Format: :MATH:DISPlay {ON|OFF} :MATH:DISPlay? Function Explanation: The commands set and query the On/Off state of the math operation. Returned Format: The query returns ON or OFF. Example: :MATH:DISP ON Enable math operation. :MATH:DISP? The query returns ON...
Page 64
Command Systems RIGOL :FFT:DISPlay? Function Explanation: The commands set and query the On/Off state of FFT operation. Returned Format: The query returns ON or OFF. Example: :FFT:DISP ON Enable FFT operation. :FFT:DISP? The query returns ON. Programming Guide for DS1000E, DS1000D Series...
Command Systems RIGOL CHANnel Commands CHANnel Commands are used to control the two channels of the oscilloscope, each channel has an independent vertical menu and each option could be set separately based on different channels. CHANnel Commands include: :CHANnel<n>:BWLimit ...
Page 66
Command Systems RIGOL :CHANnel<n>:BWLimit Command Format: :CHANnel<n>:BWLimit {ON|OFF} :CHANnel<n>:BWLimit? Function Explanation: The commands set and query the On/Off state of bandwidth limit. <n> could be 1 or 2. Returned Format: The query returns ON or OFF. Example: :CHAN2:BWL OFF Turn off the bandwidth limit to CH2.
Page 67
Command Systems RIGOL Command Format: :CHANnel<n>:DISPlay {ON|OFF} :CHANnel<n>:DISPlay? Function Explanation: The commands set and query the On/Off state of channel. <n> could be 1 or 2. Returned Format: The query returns ON or OFF. Example: :CHAN2:DISP ON Open the display of Channel 2.
Page 68
Command Systems RIGOL Function Explanation: The commands set and query the vertical offset. <n> could be 1 or 2. When Scale≥250mV, the range of <offset>is -40V~+40V; When Scale<250mV, the range of <offset>is -2V~+2V. Returned Format: The query returns the setting value of <offset>.
Page 69
Command Systems RIGOL oscilloscope. <n> could be 1 or 2. When the Probe is set to 1X, the range of <range> is 2mV ~ 10V; When the Probe is set to 5X, the range of <range> is 10mV ~50V; When the Probe is set to 10X, the range of <range> is 20mV ~ 100V;...
Page 70
Command Systems RIGOL Function Explanation: The command queries the memory depth of the specified channel. <n> could be 1 or 2. In long memory, up to 1Mpts could be stored in single channel and 512kpts in dual channels; In common memory, up to 16kpts could be stored in single channel and 8kpts in dual channels.
Command Systems RIGOL MEASure Commands MEASure Commands are used for the basic measurement only available for analog channel. Generally, the query returns the results in scientific notation. MEASure Commands include: :MEASure:CLEar :MEASure:VPP? :MEASure:VMAX? :MEASure:VMIN? :MEASure:VAMPlitude? ...
Page 72
Command Systems RIGOL :MEASure:CLEar Command Format: :MEASure:CLEar Function Explanation: The command clears the current parameter value. :MEASure:VPP? Command Format: :MEASure:VPP? [<source>] Function Explanation: The command queries the peak-peak value of the waveform under measure. <source> could be CHANnel1 or CHANnel2.
Page 73
Command Systems RIGOL Function Explanation: The command queries the minimum of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: -2.52e+03, the unit is V. :MEASure:VAMPlitude? Command Format: :MEASure:VAMPlitude? [<source>] Function Explanation: The command queries the amplitude of the waveform under measure.
Page 74
Command Systems RIGOL Function Explanation: The command queries the bottom value of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: -2.52e+03, the unit is V. :MEASure:VAVerage? Command Format: :MEASure:VAVerage? [<source>] Function Explanation: The command queries the average value of the waveform under measure.
Page 75
Command Systems RIGOL Function Explanation: The command queries the overshoot of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: 1.74e-02. 11. :MEASure:PREShoot? Command Format: :MEASure:PREShoot? [<source>] Function Explanation: The command queries the preshoot of the waveform under measure. <source>...
Page 76
Command Systems RIGOL Function Explanation: The command queries the rising time of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: 3.10e-04, the unit is s. 14. :MEASure:FALLtime? Command Format: :MEASure:FALLtime? [<source>] Function Explanation: The command measures the falling time of the waveform. <source> could be CHANnel1 or CHANnel2.
Page 77
Command Systems RIGOL Function Explanation: The command queries the positive pulse width of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.00e-04, the unit is s. 17. :MEASure:NWIDth? Command Format: :MEASure:NWIDth? [<source>] Function Explanation: The command queries the negative pulse width of the waveform under measure.
Page 78
Command Systems RIGOL Function Explanation: The command queries the negative duty cycle of the waveform under measure. <source> could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.00e-01. 20. :MEASure:PDELay? Command Format: :MEASure:PDELay? [<source>] Function Explanation: The command queries the delay relative to rising edge of channel1 or channel 2.
Page 79
Command Systems RIGOL Function Explanation: The commands set and query the On/Off state of all measurement functions. Returned Format: The query returns ON or OFF. Example: :MEAS:TOT ON Turn on all measurements. :MEAS:TOT? The query returns ON. 23. :MEASure:SOURce Command Format: :MEASure:SOURce <source>...
Command Systems RIGOL WAVeform Command WAVeform Command reads the waveform data on the screen of the oscilloscope and returns up to 1024 data. WAVeform Command includes: :WAVeform:DATA? The detailed information of each command are given as follows: Programming Guide for DS1000E, DS1000D Series...
Page 81
Command Systems RIGOL :WAVeform:DATA? Command Format: :WAVeform:DATA? [<source>] Function Explanation: The command reads the waveform data in the specified source. <source> could be CHANnel1, CHANnel2, DIGital, MATH or FFT. Returned Format: The query returns 1024 data. Programming Guide for DS1000E, DS1000D Series...
Command Systems RIGOL LA Commands LA Commands are used for controlling the acquisition and analysis to digital signals executed by logic analyzer. LA Commands include: :LA:DISPlay :DIGital<n>:TURN :DIGital<n>:POSition :LA:THReshold :LA:POSition:RESet :LA:GROUp :LA:GROUp<n>:SIZe The detailed information of each command are given as follows:...
Page 83
Command Systems RIGOL :LA:DISPlay Command Format: :LA:DISPlay {ON|OFF} :LA:DISPlay? Function Explanation: The commands set and query the On/Off state of digital channel. Returned Format: The query returns ON or OFF. Example: :LA:DISP ON Open the digital channel. :LA:DISP? The query returns ON.
Page 84
Command Systems RIGOL :DIGital<n>:POSition? Function Explanation: The commands set and query the waveform display position of specified channel. <n> could be 0~15. When choose Big-waveform, up to 8 waveforms could be displayed on the screen, and the range of <position> is 0~7;...
Page 85
Command Systems RIGOL Function Explanation: The command resets the waveform display position, that is to get the jumbled waves on the screen return to normal. :LA:GROUp Command Format: :LA:GROUp<n> {ON|OFF} :LA:GROUp<n>? Function Explanation: The commands set and query the On/Off state of GROUp1 (D7~D0) and GROUp2 (D15~D8).
Page 86
Command Systems RIGOL :LA:GROU1:SIZ? The query returns SMALL. Programming Guide for DS1000E, DS1000D Series 2-74...
Command Systems RIGOL KEY Commands KEY Commands are used for controlling the buttons and knobs on the panel of DS1000E,DS1000D series digital oscilloscopes. KEY Commands include: :KEY:LOCK :KEY:FORCe :KEY:RUN :KEY:V_POS_INC :KEY:AUTO :KEY:V_POS_DEC :KEY:CHANnel1 :KEY:V_SCALE_INC ...
Page 88
Command Systems RIGOL :KEY:LOCK Command Format: :KEY:LOCK {ENABle|DISable} :KEY:LOCK? Function Explanation: This command is used to enable/disable the buttons function on the front panel (except for “Force”). Returned Format: The query returns ENABLE or DISABLE. Example: :KEY:LOCK ENAB Enable the buttons on the front panel :KEY:LOCK? The query returns ENABLE.
Page 89
Command Systems RIGOL Command Format: :KEY:CHANnel1 Function Explanation: The command enables or disables Channel 1 and its menu display. The On/Off state of the channel along with its menu switched once you send this command continuously. :KEY:CHANnel2 Command Format: :KEY:CHANnel2 Function Explanation: The command enables or disables Channel 2 and its menu display.
Page 90
Command Systems RIGOL this command continuously. :KEY:F1 Command Format: :KEY:F1 Function Explanation: The command controls the option corresponds to F1. If some options exist in the drop-down menu relative to this key, repeat this command to select those options circularly.
Page 91
Command Systems RIGOL Function Explanation: The command controls the option corresponds to F4. If some options exist in the drop-down menu relative to this key, repeat this command to select those options circularly. 12. :KEY:F5 Command Format: :KEY:F5 Function Explanation: The command controls the option corresponds to F5.
Page 92
Command Systems RIGOL Command Format: :KEY:CURSor Function Explanation: The command enables or disables Cursor measurement and its menu display. If send this command continuously, the oscilloscope will switch among Turn off cursor, Manual, Track and Auto. 16. :KEY:ACQuire Command Format:...
Page 93
Command Systems RIGOL command continuously. 19. :KEY:UTILity Command Format: :KEY:UTILity Function Explanation: The command enables or disables Utility function and its menu display. The On/Off state of this function along with its menu switched once you send this command continuously.
Page 94
Command Systems RIGOL Function Explanation: The command sets the trigger level to the midpoint of the signal amplitude. 23. :KEY:FORCe Command Format: :KEY:FORCe Function Explanation: The command unlocks the remote control. 24. :KEY:V_POS_INC Command Format: :KEY:V_POS_INC Function Explanation: The command increases the vertical scale of the current channel in uniformly spaced.
Page 95
Command Systems RIGOL 27. :KEY:V_SCALE_DEC Command Format: :KEY:V_SCALE_DEC Function Explanation: The command is used to reduce the vertical scale of the current channel. 28. :KEY:H_SCALE_INC Command Format: :KEY:H_SCALE_INC Function Explanation: The command reduces the horizontal scale of the current channel in 5-2-1.
Page 96
Command Systems RIGOL :KEY:TRIG_LVL_DEC Function Explanation: The command reduces the trigger level in uniformly spaced. 32. :KEY:H_POS_INC Command Format: :KEY:H_POS_INC Function Explanation: The command increases the horizontal offset of the current channel in uniformly spaced. 33. :KEY:H_POS_DEC Command Format: :KEY:H_POS_DEC...
Page 97
Command Systems RIGOL Function Explanation: The command enables or disables the Delayed function. The On/Off state of the analyzer switched once you send this command continuously. 36. :KEY:FUNCtion Command Format: :KEY:FUNCtion Function Explanation: The command enables the multi-function knob. 37. :KEY:+FUNCtion...
Page 98
Command Systems RIGOL The On/Off state of the analyzer switched once you send this command continuously. 40. :KEY:PROMPT_V_POS Command Format: :KEY:PROMPT_V_POS Function Explanation: The command resets the vertical offset to zero. 41. :KEY:PROMPT_H_POS Command Format: :KEY:PROMPT_H_POS Function Explanation: The command resets the trigger offset (or the delay offset) to zero.
Command Systems RIGOL Other Commands Besides above basic commands, also there are other commands used for system language, frequency counter and beep control. Other Commands include: :INFO:LANGuage :COUNter:ENABle :BEEP:ENABle :BEEP:ACTion The detailed information of each command are given as follows:...
Page 100
Programming Examples RIGOL :INFO:LANGuage Command Format: :INFO:LANGuage <lang> :INFO:LANGuage? Function Explanation: The commands set and query the type of system language. <lang> could be SIMPlifiedChinese, TRADitionalChinese, ENGLish, KORean, JAPanese, FRENch, GERMan, RUSSian, SPANish or PORTuguese. Returned Format: The query returns Simplified Chinese, Traditional Chinese, English, Korean, Japanese, French, German, Russian, Spanish or Portuguese.
Page 101
Programming Examples RIGOL Command Format: :BEEP:ENABle {ON|OFF} :BEEP:ENABle? Function Explanation: The commands set and query the On/Off state of the beeper. Returned Format: The query returns ON or OFF. Example: :BEEP:ENAB ON Turn on the beeper. :BEEP:ENAB? The query returns ON.
(ISOLATEO) After successful connection, turn on the instrument, a dialog will guide you to install the driver of “Rigol USB Test and Measurement Device” on the PC. For VISA programming, the driver should be “USB Test and Measurement Device”. At present, you have finished the preparations. Next, we will give you some programming examples in Visual C++ 6.0 and Visual Basic 6.0 or LabView 8.6.
RIGOL Programming based on RIGOL USB Driver Program in Visual C++ 6.0 This example shows you how to create a Demo to send a command to query and return. Open Visual C++ 6.0, take the following steps: Create a project IDNDemo based on MFC.
Page 105
Note: Please select “control” of Category when adding “m_combox”, and select “value” when adding “m_receive”. Copy the Dynamic Link Library RigolTMCUsb_UI.dll from Demo files into the new project for easier use. Explanation: In IDNDemo, only three functions from this ddl are required, which are: GetTMCDeviceNum, WriteUSB and ReadUSB (the function has been mentioned in the header files Rigolusb.h);...
Page 106
RIGOL Add the codes. Enter programming environment. First all, declare “void SendToUSB(CString cmd)” and “unsigned char* Read_USB( void )” in header file, then add the following codes: //send setting command void SendToUSB(CString cmd) int temp,j; CString cmdstr; cmdstr = cmd;...
Page 107
Write(0,1,1,temp,strInput); //acquire Returned Format from the oscilloscope unsigned char* Read_USB( void ) unsigned long infoSize; //open a space to save the Returned Format int len = 100; unsigned char* strInput = new unsigned char [100]; CString str; //recal the function ReadUSB and WriteUSB from RigolTMCUsb_UI.dll HMODULE module = LoadLibrary("RigolTMCUsb_UI.dll");...
Page 108
RIGOL //return the character string getting from the oscilloscope return buffer; Dblclick the Button and add the following codes: unsigned char* readInfo; CString strInput; //char* stringTemp; CString s,strTemp; m_combox.GetLBText(m_combox.GetCurSel(),strTemp); strInput = (char *)(LPCTSTR)strTemp; SendToUSB(strInput); readInfo = Read_USB(); //display the results UpdateData (TRUE);...
Program in Visual Basic 6.0 Example 1: Query and set the channel status This example shows you how to create a Demo to query or set the channel status. Open Visual Basic 6.0, take the following steps: Create a Standard EXE project and copy the Dynamic Link Library RigolTMCUsb_UI.dll from Demo files into the new project for later use.
Page 110
RIGOL Add a subfunction as follows to send commands and get returned values. 'send a setting command Sub SendToUSB(cmd As String) Dim retcode As Boolean Dim send_buf(256) As Byte Dim temp As Long Dim cmdstr As String cmdstr = cmd...
Page 111
For i = 0 To (rSize - 1) tmpstr = tmpstr + Chr(rcv_buffer(i)) Next i Read_USB = tmpstr End Function Dblclick CH1 and add the following codes: Dim i As Long Dim sendbuf As String Dim readbuf As String rSize = 100 sendbuf = ":CHAN1:DISP?"...
Page 112
RIGOL Label1(0).ForeColor = &HFFFF& 'yellow End If Note: Codes of CH2 and MATH are similar to CH1, users can modify homologous parameters to get their codes and add them to CH2 and MATH. Dblclick Label and add the following codes:...
Page 113
Label1(1).ForeColor = &HFF0000 'blue Else Label1(1).ForeColor = &H808080 'gray End If sendbuf = ":MATH:DISP?" i = GetTMCDeviceNum Call SendToUSB(sendbuf) readbuf = Read_USB() If readbuf = "ON" Then Label1(2).ForeColor = &H800080 'purple Else Label1(2).ForeColor = &H808080 'gray End If Save and run the project, you will get a single executable program about demo. When the oscilloscope has been successfully connected with PC, you can open/close each channel conveniently by clicking the button.
Page 114
RIGOL Example 2: Read the waveform data This example shows you how to create a Demo to read the waveform data. Open Visual Basic 6.0, take the following steps: Create a Standard EXE project and copy the Dynamic Link Library RigolTMCUsb_UI.dll from Demo files into the new project for easier use.
Page 115
lpszBuffer As Long) As Boolean Private Declare Function GetDeviceNum Lib "RigolTMCUsb_UI.dll" () As Long Add a subfunction as follows to send commands and get returned values. 'send a setting command Sub SendToUSB(cmd As String) Dim retcode As Boolean Dim send_buf(256) As Byte Dim temp As Long Dim cmdstr As String cmdstr = cmd...
Page 116
RIGOL Read_USB = rSize End Function Dblclick CH1 and add the following codes: Dim i As Long Dim sendbuf As String Dim DataLen As Long Dim stepW As Integer Dim stepH As Integer sendbuf = ":WAV:DATA? CHAN1" 'initialize the USB device...
Page 117
Save and run the project, you will get a single executable program about demo. When the oscilloscope has been successfully connected with PC, you can read the waveform data of each channel conveniently by clicking the button. Programming Guide for DS1000E, DS1000D Series 3-15...
RIGOL Programming based on VISA Program in Visual C++ 6.0 Open Visual C++ 6.0, take the following steps: Create a project based on MFC. Choose Project → Settings → C/C++; select “Code Generation” in Category and “Debug Multithreaded DLL” in Use run-time library; click...
Page 119
Choose Project → Settings → Link, add the file “visa32.lib” manually in Object/library modules. 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”...
Page 120
RIGOL Add controls: Text, Com box, Button and Edit. See the figure below. 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 121
Respectively add two variables m_combox and m_receive for the controls of Com box and Edit. Programming Guide for DS1000E, DS1000D Series 3-19...
Page 122
RIGOL 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; ViChar buffer [VI_FIND_BUFLEN];...
Program in Visual Basic 6.0 Open Visual Basic 6.0, take the following steps: Create a Standard EXE project. Choose Project→Add Module→Existing; find the “visa.bas” file in the filefolder of include under the path of NI-VISA and add; Add two Command Buttons and Lables to the demo, each button denotes each channel, and each Label denotes different states (yellow and light blue which is the channel’s color indicates opening, while gray indicates close) of the channels.
Page 124
RIGOL Choose Project→Project1 Properties→General, select “Form1” from the drop down box of Startup Object. Dblclick CH1 button to enter the programming environment, add the following codes to achieve the control to it. (for CH2, the method is similar) Dim defrm As Long...
Page 125
Save and run the project, you will get a single executable program about demo. When the oscilloscope has been successfully connected with PC, you can open/close each channel conveniently by clicking the button. Programming Guide for DS1000E, DS1000D Series 3-23...
RIGOL Program in LabVIEW 8.6 Open LabVIEW 8.6, take the following steps: 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. Move the mouse to the item of “VISA resource name” on the control of “VISA Open”;...
Page 127
Separately connect “VISA resource name” with “VISA resource name out” and “error out” with “error in” of all the functions. See the figure below. Add a textbox written with “:WAV:DATA?\n” on the “VISA Write” control. while the latter reads the waveform data shown on the screen. Open the Front Panel;...
Page 128
RIGOL See the figure below. 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. See the figure below.
Page 129
After you set the “Start” event, see the result below. Programming Guide for DS1000E, DS1000D Series 3-27...
Page 130
RIGOL Add a While Loop; add “Boolean”→“True Constant” to point the event of 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. Programming Guide for DS1000E, DS1000D Series...
Page 131
11. Adjust the style of Front Panel and click “Fetch Waveform” to get following interface. (the oscilloscope has been properly connected) Programming Guide for DS1000E, DS1000D Series 3-29...
Need help?
Do you have a question about the DS1000E Series, DS1000D Series and is the answer not in the manual?
Questions and answers