RIGOL Programming Guide DS1000E, DS1000D Series Digital Oscilloscope July 2009 RIGOL Technologies, Inc.
RIGOL Copyright © 2009 RIGOL Technologies, Inc. All Rights Reserved. Trademark Information RIGOL is registered trademark of RIGOL Technologies, Inc. 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 ..............................................................................
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 ................................................................
Programming Introduction Chapter 1 RIGOL Programming Introduction This chapter provides the introduction about the interfces and commands so as to control DS1000E,DS1000D series digital oscilloscopes via remote commands.
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. Basic operations that you can do with a computer and an oscilloscope include: Set up the oscilloscope. Make measurements. Retrieve data (waveforms or measurements) from the oscilloscope.
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.
RIGOL Programming Introduction 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. 1. Braces { } The parameters enclosed in a command line must be selected. When several elements separated by a vertical line (|) are enclosed by braces, { }, only one element may be selected, for example: :MEASure:TOTal {ON|OFF}, Thereinto, {ON|OFF} indicates that only ON or OFF may be selected, not both.
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.
RIGOL Programming Introduction Parameter Type The commands contains 5 kinds of parameters, different parameters have different setting methods. 1. 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). 2.
Command Systems Chapter 2 RIGOL 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.
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.
Command Systems 1. RIGOL *IDN? Command Format: *IDN? Function Explanation: 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,, number>. ,
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.
Command Systems 1. 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. 2. :STOP Command Format: :STOP Function Explanation: The command controls the oscilloscope to stop acquiring data. To restart the acquisition, use the :RUN command. 3.
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 The detailed information of each command are given as follows: 2-6 Programming Guide for DS1000E, DS1000D Series
Command Systems 1. RIGOL :ACQuire:TYPE Command Format: :ACQuire:TYPE :ACQuire:TYPE? Function Explanation: The commands set and query the current acquire type of the oscilloscope. could be NORMal, AVERage or PEAKdetect. Returned Format: The query returns NORMAL, AVERAGE or PEAKDETECT. Example: :ACQ:TYPE AVER :ACQ:TYPE? 2. Setup the acquire type as Average. The query returns AVERAGE.
Command Systems RIGOL :ACQuire:AVERages :ACQuire:AVERages? Function Explanation: The commands set and query the average numbers in Average mode. 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. Example: :ACQ:AVER 16 :ACQ:AVER? 4. Setup the average acquisition time as 16. The query returns 16.
Command Systems RIGOL The commands set and query the memory depth of the oscilloscope. could be LONG (long memory) or NORMal (normal memory) Returned Format: The query returns LONG or NORMAL. Example: :ACQ:MEMD LONG :ACQ:MEMD? Set the memory type as LONG. The query returns LONG.
Command Systems RIGOL DISPlay Commands DISPlay Commands setup the display type of the oscilloscope.
Command Systems 1. RIGOL :DISPlay:TYPE Command Format: :DISPlay:TYPE :DISPlay:TYPE? Function Explanation: The commands set and query the display type between sampling points. could be VECTors ( vectir display) or DOTS (point display). Returned Format: The query returns VECTORS or DOTS. Example: :DISP:TYPE VECT :DISP:TYPE? 2. Setup the display type as VECTors. The query returns VECTORS.
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. Returned Format: The query returns ON or OFF. Example: :DISP:PERS ON :DISP:PERS? 4. Enable the waveform persist. The query returns ON.
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 :DISP:MNUS? 6. Open menu for current operation. The query returns ON :DISPlay:CLEar Command Format: :DISPlay:CLEar Function Explanation: The command clears out of date waveforms on the screen during waveform persist. 7.
Command Systems RIGOL 8. :DISPlay:INTensity Command Format: :DISPlay:INTensity :DISPlay:INTensity? Function Explanation: The commands set and query the brightness of the waveform. could be the integer between 0 and 32. Returned Format: The query returns the setting value of . Example: :DISP:INT 12 :DISP:INT? 2-14 Setup the waveform brightness as 12. The query returns 12.
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.
Command Systems RIGOL 1. :TIMebase:MODE Command Format: :TIMebase:MODE :TIMebase:MODE? Function Explanation: The commands set and query the scan mode of horizontal timebase. could be MAIN (main timebase) or DELayed (delayed scan). Returned Format: The query returns MAIN or DELAYED. Example: :TIM:MODE MAIN :TIM:MODE? 2. Setup the horizontal timebase as MAIN. The query returns MAIN.
Command Systems :TIM:OFFS? 3. RIGOL The query returns 1.000e+00. :TIMebase[:DELayed]:SCALe Command Format: :TIMebase[:DELayed]:SCALe :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 is 2ns - 50s; In ROLL mode, the range of is 500ms - 50s; In MAIN state, the item [:DELayed] should be omitted.
Command Systems RIGOL :TIM:FORM YT :TIM:FORM? 2-18 Setup the form of grid as YT. The query returns Y-T.
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. When the oscilloscope starts to acquire a waveform, it collects enough data so that it can display the waveform to the left of the trigger point.
Command Systems RIGOL :TRIGger:PULSe:WIDTh VIDEO Trigger :TRIGger:VIDEO:MODE :TRIGger:VIDEO:POLarity :TRIGger:VIDEO:STANdard :TRIGger:VIDEO:LINE :TRIGger:VIDEO:SENSitivity SLOPe Trigger :TRIGger:SLOPe:TIME :TRIGger:SLOPe:SENSitivity :TRIGger:SLOPe:MODE :TRIGger:SLOPe:WINDow :TRIGger:SLOPe:LEVelA :TRIGger:SLOPe:LEVelB PATTern Trigger :TRIGger:PATTern:PATTern DURation Trigger :TRIGger:DURation:PATTern :TRIGger:DURation:TIME :TRIGger:DURation:QUALifier ALTernation trigger
Command Systems RIGOL :TRIGger:ALTernation:SLOPe:LEVelA :TRIGger:ALTernation:SLOPe:LEVelB :TRIGger:ALTernation:COUPling :TRIGger:ALTernation:HOLDoff :TRIGger:ALTernation:SENSitivity The detailed information of each command are given as follows: Programming Guide for DS1000E, DS1000D Series 2-21
Command Systems RIGOL Trigger Control 1. :TRIGger:MODE Command Format: :TRIGger:MODE :TRIGger:MODE? Function Explanation: The commands set and query the mode of trigger. could be EDGE, PULSe, VIDEO, SLOPe, PATTern, DURation or ALTernation. Returned Format: The query returns EDGE, PULSE, VIDEO, SLOPE, PATTERN, DURATION or ALTERNATION. Example: :TRIG:MODE EDGE :TRIG:MODE? 2. Setup the trigger mode as EDGE. The query returns EDGE.
Command Systems RIGOL The query returns CH1, CH2, EXT, ACLINE, D0~D15. Example: :TRIG:EDGE:SOUR CHAN1 :TRIG:EDGE:SOUR? 3. Setup the soure of edge trigger as CHANnel1. The query returns CH1. :TRIGger:LEVel Command Format: :TRIGger:LEVel :TRIGger:LEVel? Function Explanation: The commands set and query the trigger level. could be :EDGE, :PULSe or :VIDEO; the range is: -6*Scale~+6*Scale, Scale indicates the current vertical scale, the unit is V/div.
Command Systems RIGOL Example: :TRIG:EDGE:SWE AUTO :TRIG:EDGE:SWE? 5. Setup the trigger type as AUTO. The query returns AUTO. :TRIGger:COUPling Command Format: :TRIGger:COUPling {DC|AC|HF|LF} :TRIGger: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. HF: Reject high frequency signals (Higher than 150KHz).
Command Systems Example: :TRIG:HOLD 0.0005 :TRIG:HOLDoff? 7. RIGOL Setup the holdoff time as 500ms. 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. Returned Format: The query returns RUN, STOP, T'D, WAIT or AUTO. 8.
Command Systems RIGOL EDGE Trigger 1. :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. Example: :TRIG:EDGE:SLOP POS :TRIG:EDGE:SLOP? 2. Set up the edge of trigger as POSitive. The query returns POSITIVE.
Command Systems RIGOL PULSe Trigger 1. :TRIGger:PULSe:MODE Command Format: :TRIGger:PULSe:MODE :TRIGger:PULSe:MODE? Function Explanation: The commands set and query the pulse condition. 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 to).
Command Systems RIGOL :TRIG:PULS:SENS 0.5 :TRIG:PULS:SENS? 3. Setup the sensitive as 0.5div. The query returns 5.00e-01. :TRIGger:PULSe:WIDTh Command Format: :TRIGger:PULSe:WIDTh :TRIGger:PULSe:WIDTh? Function Explanation: The commands set and query the pulse width. The range of is 20ns ~ 10s. Returned Format: The query returns the setting value of the in s. Example: :TRIG:PULS:WIDT 0.001 :TRIG:PULS:WIDT? 2-28 Setup the width of the pulse as 1ms. The query returns 1.000e-03.
Command Systems RIGOL VIDEO Trigger 1. :TRIGger:VIDEO:MODE Command Format: :TRIGger:VIDEO:MODE :TRIGger:VIDEO:MODE? Function Explanation: The commands set and query the synchronous mode of the video trigger. could be ODDfield, EVENfield, LINE or ALLlines. Returned Format: The query returns ODD FIELD, EVEN FIELD, LINE or ALL LINES. Example: :TRIG:VIDEO:MODE EVEN :TRIG:VIDEO:MODE? 2. Setup the synchronous mode as EVENfield.
Command Systems RIGOL 3. :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 :TRIG:VIDEO:STAN? 4. Setup the video standard as PALSecam. The query returns PAL/SECAM.
Command Systems RIGOL :TRIGger:VIDEO:SENSitivity :TRIGger:VIDEO:SENSitivity? Function Explanation: The commands set and query the trigger sensitive, the range of is: 0.1div ~1div. Returned Format: The query returns the setting value of in div. Example: :TRIG:VIDEO:SENS 0.5 :TRIG:VIDEO:SENS? Setup the trigger sensitive as 0.5div. The query returns 5.00e-01.
Command Systems RIGOL SLOPe Trigger 1. :TRIGger:SLOPe:TIME Command Format: :TRIGger:SLOPe:TIME :TRIGger:SLOPe:TIME? Function Explanation: The commands set and query the time setting about slope trigger. The range of is 20ns~10s. Returned Format: The query returns the setting value of in s. Example: :TRIG:SLOP:TIME 0.01 :TRIG:SLOP:TIME? 2. Setup the slope time is 10ms. The query returns 1.000e-02.
Command Systems 3. RIGOL :TRIGger:SLOPe:MODE Command Format: :TRIGger:SLOPe:MODE :TRIGger:SLOPe:MODE? Function Explanation: The commands set and query the slope condition. 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 to).
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 :TRIG:SLOP:WIND? 5. Setup the type of trigger level as rising edge Level A The query returns P_WIN_A. :TRIGger:SLOPe:LEVelA Command Format: :TRIGger:SLOPe:LEVelA :TRIGger:SLOPe:LEVelA? Function Explanation: The commands set and query the upper boundary “Level A” of trigger level.
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 :TRIG:SLOP:LEVB? Setup the lower boundary of trigger level as -1.5V. The query returns -1.500e+00.
Command Systems RIGOL PATTern Trigger 1. :TRIGger:PATTern:PATTern Command Format: :TRIGger:PATTern:PATTern ,, [,] :TRIGger:PATTern:PATTern? Function Explanation: The commands set and query the type of pattern for digital signal.
Command Systems RIGOL DURation Trigger 1. :TRIGger:DURation:PATTern Command Format: :TRIGger:DURation:PATTern , :TRIGger:DURation:PATTern? Function Explanation:; The commands set and query the type of pattern for digital signal. Thereinto, When is a 16-bit integer without sign, high is 1, and low is o; When is a 16-bit integer without sign, enable is 1, and X is 0. Returned Format: The query returns the setting value of , in turns.
Command Systems RIGOL 3. :TRIGger:DURation:QUALifier Command Format: :TRIGger:DURation:QUALifier :TRIGger:DURation:QUALifier? Function Explanation:; The commands set and query the limiting condition of trigger time. could be GREaterthan, LESSthan or EQUal. Returned Format: The query returns GREATER THAN, LESS THAN or EQUAL. Example: :TRIG:DUR:QUAL GRE :TRIG:DUR:QUAL? 2-38 Setup the limiting condition as “GREaterthan”. The query returns GREATER THAN.
Command Systems RIGOL ALTernation Trigger 1. :TRIGger:ALTernation:SOURce Command Format: :TRIGger:ALTernation:SOURce :TRIGger:ALTernation:SOURce? Function Explanation: The commands set and query which channel is to be used. could be CHANnel1 or CHANnel2. Returned Format: The query returns CH1 or CH2. Example: :TRIG:ALT:SOUR CHAN2 :TRIG:ALT:SOUR? 2. Select CHANnel2 as current channel. The query returns CH2.
Command Systems RIGOL 3. :TRIGger:ALTernation:TimeSCALe Command Format: :TRIGger:ALTernation:TimeSCALe :TRIGger:ALTernation:TimeSCALe? Function Explanation: The commands set and query the timebase of the current channel. The range of is: 2ns~20ms. Returned Format: The query returns the setting value of the timebase in s. Example: :TRIG:ALT:TSCAL 0.001 :TRIG:ALT:TSCAL? 4. Setup the timebase as 1ms. The query returns 1.000e-03.
Command Systems 5. RIGOL :TRIGger:ALTernation:LEVel Command Format: :TRIGger:ALTernation:LEVel :TRIGger:ALTernation:LEVel? Function Explanation: The commands set and query the trigger level of the current channel. could be :EDGE, :PULSe or :VIDEO. The range of is - 6*Scale ~ + 6*Scale,Scale indicates the current vertical scale, the unit is V/div. Returned Format: The query returns the setting value of in V.
Command Systems RIGOL Command Format: :TRIGger:ALTernation:MODE :TRIGger:ALTernation:MODE? Function Explanation: The commands set and query the current pulse condition and slope condition or the synchronization condition of the video trigger. could be :PULSe, :SLOPe or :VIDEO. In PULSe or SLOPe mode, the could be +GREaterthan, +LESSthan, + EQUal, -GREaterthan, -LESSthan or -EQUal; In VIDEO mode, the could be ODDfield, EVENfield, LINE or ALLlines.
Command Systems 9. 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 :TRIG:ALT:VIDEO:POL? Setup the video polarity as POSITIVE. The query returns POSITIVE. 10.
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 is 1~525;In AL/SECAM standard, the range of is 1~625. Returned Format: The query returns the setting value of . Example: :TRIG:ALT:VIDEO:LINE 100 :TRIG:ALT:VIDEO:LINE? Setup the number of specified line in synchronous mode as 100. The query returns 100. 12.
Command Systems RIGOL 13. :TRIGger:ALTernation:SLOPe:LEVelA Command Format: :TRIGger:ALTernation:SLOPe:LEVelA :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 is LevelB ~ +6*Scale; Scale indicates the current vertical scale, the unit is V/div. Returned Format: The query returns the setting value of in V.
Command Systems RIGOL :TRIG:ALT:SLOP:LEVB ? The query returns -1.500e+00. 15. :TRIGger:ALTernation:COUPling Command Format: :TRIGger:ALTernation:COUPling {DC|AC|HF|LF} :TRIGger:ALTernation:COUPling? Function Explanation: The commands set and query the coupling mode.
Command Systems :TRIG:ALT:PULS:HOLD 1 :TRIG:ALT:PULS:HOLD? RIGOL Setup the holdoff time as 1s. The query returns 1.000e+00. 17. :TRIGger:ALTernation:SENSitivity Command Format: :TRIGger:ALTernation:SENSitivity :TRIGger:ALTernation:SLOPe:SENSitivity? Function Explanation:; The commands set and query the trigger sensitive. The could be :EDGE, :PULSe, :SLOPe or :VIDEO. The range of 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: 2-48 Programming Guide for DS1000E, DS1000D Series
Command Systems 1. RIGOL :STORage:FACTory:LOAD Command Format: :STORage:FACTory:LOAD Function Explanation: The command recalls the system settings before leaving factory.
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.
Command Systems 1. 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 :MATH:DISP? 2. Enable math operation. The query returns ON :MATH:OPERate Command Format: :MATH:OPERate :MATH:OPERate? Function Explanation: The commands set and query the math operation type of the current channel.
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 :FFT:DISP? 2-52 Enable FFT operation. The query returns ON.
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.
Command Systems RIGOL 1. :CHANnel:BWLimit Command Format: :CHANnel:BWLimit {ON|OFF} :CHANnel:BWLimit? Function Explanation: The commands set and query the On/Off state of bandwidth limit. could be 1 or 2. Returned Format: The query returns ON or OFF. Example: :CHAN2:BWL OFF :CHAN2:BWL? 2. Turn off the bandwidth limit to CH2. The query returns OFF.
Command Systems RIGOL Command Format: :CHANnel:DISPlay {ON|OFF} :CHANnel:DISPlay? Function Explanation: The commands set and query the On/Off state of channel. could be 1 or 2. Returned Format: The query returns ON or OFF. Example: :CHAN2:DISP ON :CHAN2:DISP? 4. Open the display of Channel 2. The query returns ON. :CHANnel:INVert Command Format: :CHANnel:INVert {ON|OFF} :CHANnel:INVert? Function Explanation: The commands set and query the On/Off state of the waveform inverted.
Command Systems RIGOL Function Explanation: The commands set and query the vertical offset. could be 1 or 2. When Scale≥250mV, the range of is -40V~+40V; When Scale<250mV, the range of is -2V~+2V. Returned Format: The query returns the setting value of . Example: :CHAN2:OFFS 20 :CHAN2:OFFS? 6. Setup the vertical offset of channel 2 as 20V. The query returns 2.000e+01.
Command Systems RIGOL oscilloscope. could be 1 or 2.
Command Systems RIGOL Function Explanation: The command queries the memory depth of the specified channel. 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. Returned Format: Such as 8192 (8kpts). 10.
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.
Command Systems RIGOL 1. :MEASure:CLEar Command Format: :MEASure:CLEar Function Explanation: The command clears the current parameter value. 2. :MEASure:VPP? Command Format: :MEASure:VPP? [] Function Explanation: The command queries the peak-peak value of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.12e+03, the unit is V. 3.
Command Systems RIGOL Function Explanation: The command queries the minimum of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: -2.52e+03, the unit is V. 5. :MEASure:VAMPlitude? Command Format: :MEASure:VAMPlitude? [] Function Explanation: The command queries the amplitude of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.07e+03, the unit is V. 6.
RIGOL Command Systems Function Explanation: The command queries the bottom value of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: -2.52e+03, the unit is V. 8. :MEASure:VAVerage? Command Format: :MEASure:VAVerage? [] Function Explanation: The command queries the average value of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 4.01e+01, the unit is V. 9.
Command Systems RIGOL Function Explanation: The command queries the overshoot of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 1.74e-02. 11. :MEASure:PREShoot? Command Format: :MEASure:PREShoot? [] Function Explanation: The command queries the preshoot of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 0.00e+00. 12.
RIGOL Command Systems Function Explanation: The command queries the rising time of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 3.10e-04, the unit is s. 14. :MEASure:FALLtime? Command Format: :MEASure:FALLtime? [] Function Explanation: The command measures the falling time of the waveform. could be CHANnel1 or CHANnel2. Returned Format: Such as: 3.10e-04, the unit is s. 15.
Command Systems RIGOL Function Explanation: The command queries the positive pulse width of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.00e-04, the unit is s. 17. :MEASure:NWIDth? Command Format: :MEASure:NWIDth? [] Function Explanation: The command queries the negative pulse width of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.00e-04, the unit is s. 18.
RIGOL Command Systems Function Explanation: The command queries the negative duty cycle of the waveform under measure. could be CHANnel1 or CHANnel2. Returned Format: Such as: 5.00e-01. 20. :MEASure:PDELay? Command Format: :MEASure:PDELay? [] Function Explanation: The command queries the delay relative to rising edge of channel1 or channel 2. could be CHANnel1 or CHANnel2. Returned Format: Such as: <-1.00e-04. 21.
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 :MEAS:TOT? Turn on all measurements. The query returns ON. 23. :MEASure:SOURce Command Format: :MEASure:SOURce :MEASure:SOURce? Function Explanation: The commands select and query the current measured channel. could be CHANnel1 or CHANnel2. Returned Format: The query returns CH1 or CH2.
Command Systems RIGOL WAVeform Command WAVeform Command reads the waveform data on the screen of the oscilloscope and returns up to 1024 data.
Command Systems 1. RIGOL :WAVeform:DATA? Command Format: :WAVeform:DATA? [] Function Explanation: The command reads the waveform data in the specified source. could be CHANnel1, CHANnel2, DIGital, MATH or FFT. Returned Format: The query returns 1024 data.
Command Systems RIGOL LA Commands LA Commands are used for controlling the acquisition and analysis to digital signals executed by logic analyzer.
Command Systems 1. 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 :LA:DISP? 2. Open the digital channel. The query returns ON. :DIGital:TURN Command Format: :DIGital:TURN {ON|OFF} :DIGital:TURN? Function Explanation: The commands set and query the On/Off state of specified channel in digital channel.
Command Systems RIGOL :DIGital:POSition? Function Explanation: The commands set and query the waveform display position of specified channel. could be 0~15. When choose Big-waveform, up to 8 waveforms could be displayed on the screen, and the range of is 0~7; when choose Small-waveform, up to 16 waveforms could be displayed on the screen, and the range of is 0~15. Returned Format: The query returns the setting value of . Example: :DIG2:POS 3 :DIG2:POS? 4.
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. 6. :LA:GROUp Command Format: :LA:GROUp {ON|OFF} :LA:GROUp? Function Explanation: The commands set and query the On/Off state of GROUp1 (D7~D0) and GROUp2 (D15~D8). could be 1 or 2. Returned Format: The query returns ON or OFF. Example: :LA:GROU1 ON :LA:GROU1? 7. Turn on the group D7~D0. The query returns ON.
Command Systems RIGOL :LA:GROU1:SIZ? 2-74 The query returns SMALL.
Command Systems RIGOL KEY Commands KEY Commands are used for controlling the buttons and knobs on the panel of DS1000E,DS1000D series digital oscilloscopes.
Command Systems RIGOL 1. :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 :KEY:LOCK? 2. Enable the buttons on the front panel The query returns ENABLE. :KEY:RUN Command Format: :KEY:RUN Function Explanation: The command controls the operating mode of the oscilloscope.
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. 5. :KEY:CHANnel2 Command Format: :KEY:CHANnel2 Function Explanation: The command enables or disables Channel 2 and its menu display. The On/Off state of the channel along with its menu switched once you send this command continuously. 6.
RIGOL Command Systems this command continuously. 8. :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. 9. :KEY:F2 Command Format: :KEY:F2 Function Explanation: The command controls the option corresponds to F2.
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. If some options exist in the drop-down menu relative to this key, repeat this command to select those options circularly. 13.
RIGOL Command Systems 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: :KEY:ACQuire Function Explanation: The command enables or disables Sample function and its menu display. The On/Off state of this function along with its menu switched once you send this command continuously. 17.
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. 20. :KEY:MNUTIME Command Format: :KEY:MNUTIME Function Explanation: The command enables or disables Horizontal system and its menu display.
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. 25.
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. 29. :KEY:H_SCALE_DEC Command Format: :KEY:H_SCALE_DEC Function Explanation: The command increases the horizontal scale of the current channel in 1-2-5. 30.
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 Function Explanation: The command reduces the horizontal offset of the current channel in uniformly spaced. 34.
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 Command Format: :KEY:+FUNCtion Function Explanation: The command increases the offset of the multi-function knob. 38.
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. 42.
Command Systems RIGOL Other Commands Besides above basic commands, also there are other commands used for system language, frequency counter and beep control.
Programming Examples 1. RIGOL :INFO:LANGuage Command Format: :INFO:LANGuage :INFO:LANGuage? Function Explanation: The commands set and query the type of system language. 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. Example: :INFO:LANG SIMP :INFO:LANG? 2.
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 :BEEP:ENAB? 4. Turn on the beeper. The query returns ON. :BEEP:ACTion Command Format: :BEEP:ACTion Function Explanation: The command makes the oscilloscope buzzed once (no matter whether the beeper is on or not).
Command Systems Chapter 3 RIGOL Programming Examples This chapter lists some programming examples about how to realize the basic functions of the oscilloscope in the development environments of Visual C++ 6.0, Visual Basic 6.0 or LabView 8.6. Users can programme the oscilloscope based on the USB driver provided by RIGOL or VISA library. For VISA programming, your computer must have been installed the NI-VISA which can be downloaded from http://www.ni.com.
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: 1. Create a project IDNDemo based on MFC. 2. Add controls: 3. 1) Modify the properties of the controls. Name the Button to be “Send and Read”. See the figure below.
Note: Please select “control” of Category when adding “m_combox”, and select “value” when adding “m_receive”. 4. 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.
RIGOL 5. Add the codes. Enter the programming environment. First of 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; unsigned char * strInput; //recall the GetTMCDeviceNum and WriteUSB RigolTMCUsb_UI.dll HMODULE module = LoadLibrary("RigolTMCUsb_UI.
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.
RIGOL //return the character string getting from the oscilloscope return buffer; } 6. 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); m_receive = readInfo; UpdateData (FALSE); 7.
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: 1. Create a Standard EXE project and copy the Dynamic Link Library RigolTMCUsb_UI.dll from Demo files into the new project for later use. 2. Named Form1 “Demo”.
RIGOL 4. 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 temp = Len(cmdstr) For i = 0 To temp - 1 tempStr = Mid(cmdstr, i + 1, 1) send_buf(i) = Asc(tempStr) Next i 'send a command to the oscilloscope 'the definition of interface has been mentioned in Rigolusb.
For i = 0 To (rSize - 1) tmpstr = tmpstr + Chr(rcv_buffer(i)) Next i Read_USB = tmpstr End Function 5.
RIGOL Label1(0).ForeColor = &HFFFF& End If 'yellow 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. 6. Dblclick Label and add the following codes: Dim i As Long Dim sendbuf As String Dim readbuf As String rSize = 100 sendbuf = ":CHAN1:DISP?" i = GetTMCDeviceNum Call SendToUSB(sendbuf) readbuf = Read_USB() If readbuf = "ON" Then Label1(0).ForeColor = &HFFFF& 'yellow Else Label1(0).
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 7. 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.
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: 1. Create a Standard EXE project and copy the Dynamic Link Library RigolTMCUsb_UI.dll from Demo files into the new project for easier use. 2. Named Form1 “Demo”. Then add two Commandbuttons (CH1 and CH2) and a PictureBox for showing the waveform data about CH1 and CH2, please see the figure below: 3.
lpszBuffer As Long) As Boolean Private Declare Function GetDeviceNum Lib "RigolTMCUsb_UI.dll" () As Long 5. Add a subfunction as follows to send commands and get returned values.
RIGOL Read_USB = rSize End Function 6. Dblclick CH1 and add the following codes: Dim Dim Dim Dim Dim i As Long sendbuf As String DataLen As Long stepW As Integer stepH As Integer sendbuf = ":WAV:DATA? CHAN1" 'initialize the USB device i = GetTMCDeviceNum 'send a query command and read the results Call SendToUSB(sendbuf) DataLen = Read_USB() stepW = Picture1.Width stepH = Picture1.Height / 256 'clear the waveform Picture1.
7. 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.
RIGOL Programming based on VISA 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 OK.
3. Choose Project → Settings → Link, add the file “visa32.lib” manually in Object/library modules. 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”: C:\Program Files\IVI Foundation\VISA\WinNT\lib\msc.
RIGOL 5. Add controls: Text, Com box, Button and Edit. See the figure below. 6. Modify the properties of the controls. 1) Name the Text to be “Command”. 2) Choose Data in the property of Com box, input three commands manually: *IDN? *OPC? :ACQuire:TYPE? 3) Choose General in the property of Edit and select Disable. 4) Modify the name of Button such as: Send and Read.
7. Respectively add two variables m_combox and m_receive for the controls of Com box and Edit.
RIGOL 8. Add the codes. Dblclick the Button, enter the programming environment. First of all, declare “#include
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; 3. 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. See the figure below.
RIGOL 4. Choose Project→Project1 Properties→General, select “Form1” from the drop down box of Startup Object. 5. 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 Dim Dim Dim Dim Dim defrm As Long vi As Long strRes As String * 200 list As Long nmatches As Long matches As String * 200 ' reserve to acquire the equipment ID.
6. 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.
RIGOL 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”; right-click the mouse to choose Create→Control. See the figure below.
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:DATA?\n” on the “VISA Write” control. while the latter reads the waveform data shown on the screen. 5. Open the Front Panel; choose Modern→Graph→Waveform Graph to add a Waveform Graph control. See the figure below. 6.
RIGOL 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. See the figure below. 8. Right-click the “selector label” and choose “Edit Events Handled by This Case” or “Add Event case” to add events respectively for each button. Press “Start” to capture waveform and “Stop” to exit the program.
After you set the “Start” event, see the result below.
RIGOL 9. 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.
11. Adjust the style of Front Panel and click “Fetch Waveform” to get following interface.
Command Quick Reference A-Z RIGOL Command Quick Reference A-Z *IDN? 2-3 *RST 2-3 :DISPlay:CLEar 2-13 :DISPlay:BRIGhtness 2-13 :DISPlay:INTensity 2-14 :DIGital:TURN 2-71 :DIGital:POSition 2-71 A :AUTO 2-5 :ACQuire:TYPE 2-7 :ACQuire:MODE 2-7 :ACQuire:AVERages 2-7 :ACQuire:SAMPlingrate? 2-8 :ACQuire:MEMDepth F :FFT:DISPlay 2-51 :FORCetrig 2-25 2-8 B :BEEP:ENABle 2-88 :BEEP:ACTion 2-89 C :CHANnel:BWLimit 2-54 :CHANnel:COUPling 2-54 :CHANnel:DISPlay 2-54 :CHANnel:INVert 2-55 :CHAN
Command Quick Reference A-Z RIGOL :KEY:STORage 2-80 :KEY:UTILity 2-81 :KEY:MNUTIME 2-81 :KEY:MNUTRIG 2-81 :KEY:Trig%50 2-81 :KEY:FORCe 2-82 :KEY:V_POS_INC 2-82 :KEY:V_POS_DEC 2-82 :KEY:V_SCALE_INC 2-82 :KEY:V_SCALE_DEC 2-83 :KEY:H_SCALE_INC 2-83 :KEY:H_SCALE_DEC 2-83 :KEY:TRIG_LVL_INC 2-83 :KEY:TRIG_LVL_DEC 2-83 :KEY:H_POS_INC 2-84 :KEY:H_POS_DEC 2-84 :KEY:PROMPT_V 2-84 :KEY:PROMPT_H 2-84 :KEY:FUNCtion 2-85 :KEY:+FUNCtion 2-85 :KEY:-FUNCtion 2-85 :KEY:LA 2-85 :KEY:PROMPT_V_POS 2-86 :KEY:PROMPT_H_POS 2-86
Command Quick Reference A-Z :TRIGger:SWEep 2-23 :TRIGger:COUPling 2-24 :TRIGger:HOLDoff 2-24 :TRIGger:STATus? 2-25 :Trig%50 2-25 :TRIGger:EDGE:SLOPe 2-26 :TRIGger:EDGE:SENSitivity 2-26 :TRIGger:PULSe:MODE 2-27 :TRIGger:PULSe:SENSitivity 2-27 :TRIGger:PULSe:WIDTh 2-28 :TRIGger:VIDEO:MODE 2-29 :TRIGger:VIDEO:POLarity 2-29 :TRIGger:VIDEO:STANdard 2-30 :TRIGger:VIDEO:LINE 2-30 :TRIGger:VIDEO:SENSitivity 2-30 :TRIGger:SLOPe:TIME 2-32 :TRIGger:SLOPe:SENSitivity 2-32 :TRIGger:SLOPe:MODE 2-33 :TRIGger: