Page 1
RIGOL Programming Guide DS1000CA Series Digital Oscilloscope DS1302CA, DS1202CA, DS1102CA, DS1602CA Sept. 2010 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.
KEY Commands ................... 2-66 CURSor Commands ................2-78 Other Commands ................. 2-85 Chapter 3 Programming Example ............3-1 Prepare for Programming ................ 3-2 Program in Visual C++ 6.0 ..............3-3 Program in Visual Basic 6.0 ..............3-8 Programming Guide for DS1000CA Series...
Page 5
RIGOL Program in LabVIEW 8.6 ............... 3-10 Program in Visual C++ 6.0 via Serial Port ..........3-16 Command Quick Reference A-Z ..............1 Programming Guide for DS1000CA Series...
Programming Introduction RIGOL Chapter 1 Programming Introduction This chapter provides the introduction about the interfces and commands so as to control DS1000CA series digital oscilloscopes via remote commands. The chapter contains following topics: Communication Interfaces Command Introduction Command Syntax...
“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 Guide for DS1000CA Series...
RIGOL Command Introduction Command Syntax The command system of DS1000CA series digital oscilloscopes presents a multistate 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 “:”...
Thereinto, [:DELayed] could be omitted. Triangle Brackets < > Items enclosed in < > should be replaced by an effective value, for example: :DISPlay:BRIGhtness <ncount> Thereinto, < ncount > must be a numerical value such as 25. Programming Guide for DS1000CA Series...
RIGOL Command Abbreviation All the commands of DS1000CA series are case-sensitive, so you can use any kind of them. As some commands are too long to memory and spell, we set the abbreviation for the commands in order to reduce your work and memory difficulty.
Thereinto, <count> could be 2, 4, 8, 16, 32, 64, 128, 256. 5. ASCII Character String The parameter should a combination of ASCII character string, for example: :TRIGger:MODE <mod> Thereinto, <mod> could be “EDGE”, ”PULSe”, ”VIDEO”, ”SLOPe” or “ALTernation”. Programming Guide for DS1000CA Series...
RIGOL Chapter 2 Command Systems This chapter gives detailed information on each command supported by DS1000CA series oscilloscopes, including command format, function explanation, using methods and considerations. DS1000CA series include the following commands: General Commands SYSTem Commands ACQuire Commands ...
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 keyword. DS1000CA series digital oscilloscopes support the following general commands: *IDN? *RST ...
Page 15
This command is used to query the manufacturer, model, sequence number and the version number composed of numbers and separated by “.”. Returned Format: RIGOL TECHNOLOGIES,<model>,<sequence_number>,<rev_number> Example: RIGOL TECHNOLOGIES,DS1302CA,DS1AA093200284,03.08.01 *RST Command Format: *RST Function Explanation: This command is used to reset the system parameters. Programming Guide for DS1000CA Series...
They can either be used for operational control or screen data interception and more. System Commands include: :RUN :STOP :AUTO :HARDcopy The detailed information of each command are given as follows: Programming Guide for DS1000CA Series...
Page 17
:HARDcopy Function Explanation: This command is to extract the current information on the screen, and then copy the bitmap into the U disc in the form of “HardCopyxxx.bmp”. (Note:This command is unavailable in file systems). Programming Guide for DS1000CA Series...
ACQuire Commands ACQuire Commands are used to adjust the acquisition modes of the oscilloscope. ACQuire Commands include: :ACQuire:TYPE :ACQuire:MODE :ACQuire:AVERages :ACQuire:SAMPlingrate? The detailed information of each command are given as follows: Programming Guide for DS1000CA Series...
Page 19
The commands are used to set and query the current acquisition mode. The options of <mode> are “RTIMe” and “ETIMe”. Returned Format: Query returns “REAL_TIME” or “EQUAL_TIME”. Example: :ACQ:MODE ETIM Set the acquisition mode as “ETIMe” :ACQ:MODE? Query returns “EQUAL_TIME” :ACQuire:AVERages Command Format: Programming Guide for DS1000CA Series...
Page 20
<n> could be 1 or 2 which means channel 1 or channel 2. Returned Format: Query returns the value of the sampling rate. Example: :ACQ:SAMP? CHAN2 Query the smpling rate of channel2 1.250e+08 Query returns 125Msa/s Programming Guide for DS1000CA Series...
DISPlay Commands are used to adjust the display mode of oscilloscopes. Display Commands include: :DISPlay:TYPE :DISPlay:GRID :DISPlay:PERSist :DISPlay:MNUDisplay :DISPlay:MNUStatus :DISPlay:CLEar :DISPlay:BRIGhtness :DISPlay:INTensity :DISPlay:SCReen The detailed information of each command are given as follows: Programming Guide for DS1000CA Series...
Page 22
<grid> are “FULL” (set the grid and coordinate on), “HALF” (set the grid on) or “NONE” (set the grid and coordinate off). Returned Format: Query returns “FULL”, “HALF” or “NONE”. Example: :DISP:GRID FULL Set the grid state as “FULL” :DISP:GRID? Query returns “FULL” 2-10 Programming Guide for DS1000CA Series...
Page 23
<time> are: 1s, 2s, 5s, 10s, 20s or Infinite. Returned Format: Query returns 1s, 2s, 5s, 10s, 20s or Infinite. Example: :DISP:MNUD 10 Set the display time of the menu as 10s :DISP:MNUD? Query returns 10s :DISPlay:MNUStatus Command Format: :DISPlay:MNUStatus {ON|OFF} 2-11 Programming Guide for DS1000CA Series...
Page 24
The commands are used to set and query the grid brightness of the display from 0 and 32. Returned Format: Query returns an integer between 0 and 32. Example: :DISP:BRIG 10 Set the grid brightness of the display as 10 2-12 Programming Guide for DS1000CA Series...
Page 25
The commands are used to set and query the screen display mode. The options of <scr> are “NORmal” or “INVerted”. Returned Format: Query returns “NORMAL” or “INVERTED”. Example: :DISP:SCR NORM Set the display mode as “NORmal” :DISP:SCR? Query returns “NORMAL” 2-13 Programming Guide for DS1000CA Series...
(trigger offset). The waveform will enlarge or shrink when the horizontal Scale changed. TIMebase Commands include: :TIMebase:MODE :TIMebase[:DELayed]:OFFSet :TIMebase[:DELayed]:SCALe :TIMebase:FORMat The detailed information of each command are given as follows: 2-14 Programming Guide for DS1000CA Series...
Page 27
When “MAIN” is “ON”, [: DELayed] should be omitted, the range of <offset> is: MainOffset+6*(DelayScale-MainScale) ~ MainOffset+6*(MainScale-DelayScale) Returned Format: Query returns the set value of <offset> in scientific numeric notation in s. 2-15 Programming Guide for DS1000CA Series...
Page 28
Set the timebase scale as 2s :TIM:SCAL? Query returns 2.000e+00 :TIMebase:FORMat Command Format: :TIMebase:FORMat <value> :TIMebase: FORMat? Function Explanation: The commands are used to set and query the timebase. The options of <value> are “XY”, “YT” or “SCANning”. 2-16 Programming Guide for DS1000CA Series...
Page 29
Programming Introduction RIGOL Returned Format: Query returns “X-Y”, “Y-T‟ or “SCANNING”. Example: :TIM:FORM YT Set the format of the timebase as “YT” mode :TIM:FORM? Query returns “Y-T” 2-17 Programming Guide for DS1000CA Series...
When <mode> is “:SLOPE”, <src> can be CHANnel<n>, EXT or EXT5; When <mode> is “:VIDEO”, <src> can be CHANnel<n>, EXT or EXT5. <n> is 1 or 2. Returned Format: Query returns “CH1”, “CH2”, “EXT”, “EXT5” or “ACLINE”. 2-20 Programming Guide for DS1000CA Series...
Page 33
The commands are used to set and query the trigger type as “AUTO”, “NORMal” or “SIMGle”. The options of <mode> are “:EDGE”, “:PULSe”, “VIDEO” or “:SLOPe”. Returned Format: Query returns “AUTO”, “NORMAL” or “SINGLE”. 2-21 Programming Guide for DS1000CA Series...
Page 34
:TRIGger:HOLDoff? Function Explanation: The commands are used to set and query trigger holdoff. The range of <count> is 500ns~1.5s. Returned Format: Query returns the set value of <count> in scientific numeric notation in s. 2-22 Programming Guide for DS1000CA Series...
Page 35
The command sets the trigger level to the vertical middle of the signal amplitude. :FORCetrig Command Format: :FORCetrig Function Explanation: The command forces the oscilloscope to display a steady waveform when there is no suitable trigger condition, which is usually used in “Normal” and “Single” trigger mode. 2-23 Programming Guide for DS1000CA Series...
The range of <count> is 0.1~1. Returned Format: Query returns the set value of <count> in scientific numeric notation in div. Example: :TRIG:EDGE:SENS 0.5 Set the trigger sensitivity as 0.5div :TRIG:EDGE:SENS? Query returns 5.00e-01 2-24 Programming Guide for DS1000CA Series...
The commands are used to set and query the trigger sensitivity of PULSe tigger. The range of <count> is 0.1~1. Returned Format: Query returns the set value of <count> in scientific numeric notation in div. Example: :TRIG:PULS:SENS 0.5 Set the trigger sensitivity as 0.5div 2-25 Programming Guide for DS1000CA Series...
Page 38
The commands are used to set and query the pulse width from 20ns to 10s. Returned Format: Query returns the set value of <wid> in scientific numeric notation in s. Example: :TRIG:PULS:WIDT 0.001 Set the pulse width as 1ms :TRIG:PULS:WIDT? Query returns 1.000e-03 2-26 Programming Guide for DS1000CA Series...
The commands are used to set and query the Video polarity as “POSitive” or “NEGative”. Returned Format: Query returns “POSITIVE” or “NEGATIVE”. Example: :TRIG:VIDEO:POL POS Set the Video polarity as “POSitive” :TRIG:VIDEO:POL? Query returns “POSITIVE” 2-27 Programming Guide for DS1000CA Series...
Page 40
In NTSC standard, the range of <value> is 1~525; In PALSecam standard, the range of <value> is 1~625. Returned Format: Query returns the set value of lines. Example: :TRIG:VIDEO:LINE 25 Set number of synchronous appointed lines as 25 :TRIG:VIDEO:LINE? Query returns 25 2-28 Programming Guide for DS1000CA Series...
Page 41
The range of <count> is 0.1~1. Returned Format: Query returns the set value of <count> in scientific numeric notation in div. Example: :TRIG:VIDEO:SENS 0.5 Set the trigger sensitivity as 0.5div :TRIG:VIDEO:SENS? Query returns 5.00e-01 2-29 Programming Guide for DS1000CA Series...
The range of <count> is 0.1~1. Returned Format: Query returns the set value of <count> in scientific numeric notation in div. Example: :TRIG:SLOP:SENS 0.5 Set the trigger sensitivity as 0.5div :TRIG:SLOP:SENS? Query returns 5.00e-01 2-30 Programming Guide for DS1000CA Series...
Page 43
The options of <count> are “PA”, “PB” or “PAB” when slope condition is “+GREaterthan”, “+LESSthan” or “+EQUal”; The options of <count> are “NA”, “NB” or “NAB” when slope condition is “-GREaterthan”, “-LESSthan” or “-EQUal”; Returned Format: Query returns “P_WIN_A”, “P_WIN_B”, “P_WIN_AB”, “N_WIN_A”, “N_WIN_B” or “N_WIN_AB”. 2-31 Programming Guide for DS1000CA Series...
Page 44
“level” is V/div. Returned Format: Query returns the set value of <value> in scientific numeric notation in V. Note: Minimum of Level A couldn’t be less than maximum of Level B. 2-32 Programming Guide for DS1000CA Series...
Page 45
Programming Introduction RIGOL Example: :TRIG:SLOP:LEVB -1.5 Set the lower trigger level as -1.5V :TRIG:SLOP:LEVB? Query returns -1.500e+00 2-33 Programming Guide for DS1000CA Series...
The commands are used to set and query trigger type. The options of <type> are “EDGE”, “PULSe”, “SLOPe” or “VIDEO”. Returned Format: Query returns “EDGE”, “PULSE”, “SLOPE” or “VIDEO”. Example: :TRIG:ALT:TYPE EDGE Set trigger type as “EDGE” :TRIG:ALT:TYPE? Query returns “EDGE” 2-34 Programming Guide for DS1000CA Series...
Page 47
Returned Format: Query returns the set value of <value> in scientific numeric notation in s. Example: :TRIG:ALT:TOFFS 0.0002 Set up current horizontal time base as 200us :TRIG:ALT:TOFFS? Query returns 2.000e-04 2-35 Programming Guide for DS1000CA Series...
Page 48
The commands are used to set and query the edge polarity of EDGE trigger in current channel. The options of <value> are “POSitive”, “NEGative” or “ALTernation”. Returned Format: Query returns “POSITIVE”, “NEGATIVE” or “ALTernation”. Example: :TRIG:ALT:EDGE:SLOP POS Set the edge polarity as “POSitive” :TRIG:ALT:EDGE:SLOP? Query returns “POSITIVE” 2-36 Programming Guide for DS1000CA Series...
Page 49
The commands are used to set and query pulse width or slope time. The options of <mode> are “:SLOPe” or “:PULSe”. The range of <value> is 2ns~10s. Returned Format: Query returns the set value of <value> in scientific numeric notation in s. Example: 2-37 Programming Guide for DS1000CA Series...
Page 50
Function Explanation: The commands are used to set the video standard as “NTSC” or “PALSecam”. Returned Format: Query returns “NTSC” or “PAL/SECAM”. Example: :TRIG:ALT:VIDEO:STAN NTSC Set the video standard as “NTSC” :TRIG:ALT:VIDEO:STAN? Query returns “NTSC” 2-38 Programming Guide for DS1000CA Series...
Page 51
The options of <count> are “PA”, “PB” or “PAB” when slope condition is “+GREaterthan”, “+LESSthan” or “+EQUal”; The options of <count> are “NA”, “NB” or “NAB” when slope condition is “-GREaterthan”, “-LESSthan” or “-EQUal”. Returned Format: Query returns “P_WIN_A”, “P_WIN_B”, “P_WIN_AB”, “N_WIN_A”, “N_WIN_B” or “N_WIN_AB”. Example: 2-39 Programming Guide for DS1000CA Series...
Page 52
V/div. Note: The minimum of Level A couldn’t be less than maximum of Level B. Returned Format: Query returns the set value of <value> in scientific numeric notation in V. 2-40 Programming Guide for DS1000CA Series...
Page 53
Command Format: :TRIGger:ALTernation<mode>:HOLDoff <count> :TRIGger:ALTernation<mode>:HOLDoff? Function Explanation: The commands are used to set and query the trigger holdoff. The options of <mode> are :EDGE, :PULSe, :SLOPe or :VIDEO. The range of <count> is 500ns~1.5s. 2-41 Programming Guide for DS1000CA Series...
Page 54
The range of <count> is 0.1~1. Returned Format: Query returns the set value of <count> in scientific numeric notation in div. Example: :TRIG:ALT:EDGE:SENS 0.5 Set the trigger sensitivity as 0.5div :TRIG:ALT:EDGE:SLOP:SENS? Query returns 5.00e-01 2-42 Programming Guide for DS1000CA Series...
Programming Introduction RIGOL STORage Commands STORage Command is used to recall the factory settings. STORage Command includes: :STORage:FACTory:LOAD The detailed information of this command is given below: 2-43 Programming Guide for DS1000CA Series...
Page 56
Programming Introduction RIGOL :STORage:FACTory:LOAD Command Format: :STORage:FACTory:LOAD Function Explanation: The command is used to recall the factory settings. 2-44 Programming Guide for DS1000CA Series...
MATH Commands include: :MATH:DISPlay :MATH:OPERate :FFT:DISPlay The detailed information of each command are given as follows: 2-45 Programming Guide for DS1000CA Series...
Page 58
The options of <operate> are A+B, A-B, AB or FFT. Returned Format: Query returns A+B, A-B, A*B or FFT. Example: :MATH:OPER AB Set the type of math operation as AB :MATH:OPER? Query returns A*B :FFT:DISPlay Command Format: :FFT:DISPlay {ON|OFF} 2-46 Programming Guide for DS1000CA Series...
Page 59
Function Explanation: The commands are used to set and query the FFT function ”ON” or “OFF”. Returned Format: Query returns “ON” or “OFF”. Example: :FFT:DISP ON Set the FFT function on :FFT:DISP? Query returns “ON” 2-47 Programming Guide for DS1000CA Series...
CHANnel Commands include: :CHANnel<n>:BWLimit :CHANnel<n>:COUPling :CHANnel<n>:DISPlay :CHANnel<n>:INVert :CHANnel<n>:OFFSet :CHANnel<n>:PROBe :CHANnel<n>:SCALe :CHANnel<n>:FILTer :CHANnel<n>:VERNier :CHANnel<n>:INPut The detailed information of each command are given as follows: 2-48 Programming Guide for DS1000CA Series...
Page 61
The commands are used to set and query the coupling as “DC”, “AC” or “GND”. <n> is 1 or 2. Returned Format: Query returns “DC”, “AC” or “GND”. Example: :CHAN2:COUP DC Set the coupling type of Channel 2 as “DC” :CHAN2:COUP? Query returns “DC” 3. :CHANnel<n>:DISPlay Command Format: 2-49 Programming Guide for DS1000CA Series...
Page 62
The commands are used to set and query the waveform invert “ON” or “OFF”. Returned Format: Query returns “ON” or “OFF”. Example: :CHAN2:INV OFF Set the waveform invert of channel 2 “OFF” :CHAN2:INV? Query returns “OFF”. 5. :CHANnel<n>:OFFSet Command Format: :CHANnel<n>:OFFSet <offset> :CHANnel<n>:OFFSet? 2-50 Programming Guide for DS1000CA Series...
Page 63
Returned Format: Query returns the set value of <attn> in scientific numeric notation. Example: :CHAN2:PROB 10 Set probe attenuation of channel 2 as 10X :CHAN2:PROB? Query returns 1.000e+01 7. :CHANnel<n>:SCALe Command Format: :CHANnel<n>:SCALe <range> :CHANnel<n>:SCALe? 2-51 Programming Guide for DS1000CA Series...
Page 64
The commands are used to set and query the digital filter “ON” or “OFF”. <n> is 1 or 2. Returned Format: Query returns “ON” or “OFF”. Example: :CHAN2:FILT OFF Set the digital filter of channel 2 off :CHAN2:FILT? Query returns “OFF” 2-52 Programming Guide for DS1000CA Series...
Page 65
Returned Format: Query returns “50ohm” or “1Mohm”. Example: :CHAN2: INP 50OHM Set the input impedance of channel2 as 50Ω :CHAN2: INP? Query returns “50ohm” Note: This command is effective only for DS1202CA and DS1302CA . 2-53 Programming Guide for DS1000CA Series...
:MEASure:RISetime? :MEASure:FALLtime? :MEASure:PERiod? :MEASure:PWIDth? :MEASure:NWIDth? :MEASure:PDUTycycle? :MEASure:NDUTycycle? :MEASure: PDELay? :MEASure:NDELay? :MEASure:TOTal :MEASure:SOURce The detailed information of each command are given as follows: 2-54 Programming Guide for DS1000CA Series...
Page 67
This command is used to query the maximum value of the waveform. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as 3.24e+03, unit is V. 4. :MEASure:VMIN? Command Format: :MEASure:VMIN? [<source>] 2-55 Programming Guide for DS1000CA Series...
Page 68
This command is used to query the top value of the waveform. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as 3.24e+03, unit is V. 7. :MEASure:VBASe? Command Format: :MEASure:VBASe? [<source>] 2-56 Programming Guide for DS1000CA Series...
Page 69
This command is used to query the root-mean-square value of the waveform. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as 1.36e+06, unit is V. 10. :MEASure:OVERshoot? Command Format: :MEASure:OVERshoot? [<source>] 2-57 Programming Guide for DS1000CA Series...
Page 70
Command Format: :MEASure:FREQuency? [<source>] Function Explanation: This command is used to query the waveform frequency. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as 1.00e+03, the unit is Hz. 13. :MEASure:RISetime? 2-58 Programming Guide for DS1000CA Series...
Page 71
Command Format: :MEASure:PERiod? [<source>] Function Explanation: This command is used to query the waveform period. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as 1.00e-03, the unit is s. 16. :MEASure:PWIDth? 2-59 Programming Guide for DS1000CA Series...
Page 72
Generally, duty cycle is in terms of percentage, and the transformational relation of the overshoot value and percentage is: PDUT*100. For example: PDUT = 5.00e-1 mens this duty cycle is 50%. Returned Format: Such as 5.00e-01. 2-60 Programming Guide for DS1000CA Series...
Page 73
Function Explanation: This command is used to query the the delay of channel 1 or channel 2 relative to the negative edge. The options of <source> are CHANnel1 or CHANnel2. Returned Format: Such as <-1.00e-04. 2-61 Programming Guide for DS1000CA Series...
Page 74
The commands are used to set and query the current channel. The options of <source> are “CHANnel1” or “CHANnel2”. Returned Format: Query returns “CH1” or “CH2”. Example: :MEAS:SOUR CHAN1 Measure the waveform of “CHANnel1” :MEAS:SOUR? Query returns “CH1” 2-62 Programming Guide for DS1000CA Series...
Programming Introduction RIGOL WAVeform Commands WAVeform Commands are used to read the waveform datum. WAVeform Commands include: :WAVeform:DATA? :WAVeform:MEMORYDATA? :WAVeform:POINts:MODE The detailed information of each command are given as follows: 2-63 Programming Guide for DS1000CA Series...
Page 76
Note*: The half-channel state means only one channel is open, the MATH function is closed and the timebase should be less than 20ns. Returned Format: Query returns the data have been read. :WAVeform:POINts:MODE Command Format: :WAVeform:POINts:MODE <points_mode> :WAVeform:POINts:MODE? Function Explanation: 2-64 Programming Guide for DS1000CA Series...
Page 77
NORMal; in STOP 5120 state, MAX is the Half-Channel 10240 same with RAW. Returned Format: The query returns NORMal, MAXimum or RAW. Example: :WAV:POIN:MODE NORM Set the mode as NORMal. :WAV:POIN:MODE? Return NORMal. 2-65 Programming Guide for DS1000CA Series...
:KEY:ACQuire :KEY:+FUNCtion :KEY:DISPlay :KEY:-FUNCtion :KEY:STORage :KEY:PROMPT_V_POS :KEY:UTILity :KEY:PROMPT_H_POS :KEY:MNUTIME :KEY:PROMPT_TRIG_LVL :KEY:MNUTRIG :KEY:OFF The detailed information of each command are given as follows: 2-66 Programming Guide for DS1000CA Series...
Page 79
Repeating the command would make the oscilloscope switched between RUN and STOP. :KEY:AUTO Command Format: :KEY:AUTO Function Explanation: This command is equivalent to the AUTO key, which enables the oscilloscope to set the optimum conditions to display the input signal (waveform). 2-67 Programming Guide for DS1000CA Series...
Page 80
Function Explanation: This command is used to set the on-state for MATH function and its menu. Repeating the command would make the function switched between ON and OFF. :KEY:REF Command Format: :KEY:REF Function Explanation: 2-68 Programming Guide for DS1000CA Series...
Page 81
10. :KEY:F3 Command Format: :KEY:F3 Function Explanation: This command is similar to press and select the option of Menu F3. Repeating this command would enter next level of menu. 11. :KEY:F4 Command Format: :KEY:F4 2-69 Programming Guide for DS1000CA Series...
Page 82
Command Format: :KEY:MEASure Function Explanation: This command is used to set the on-state for measure function and its menu. Repeating the command would make the measure switched between ON and OFF. 15. :KEY:CURSor Command Format: 2-70 Programming Guide for DS1000CA Series...
Page 83
OFF. 18. :KEY:STORage Command Format: :KEY:STORage Function Explanation: This command is used to set the on-state for storage function and its menu. Repeating the command would make the storage switched between ON and OFF. 2-71 Programming Guide for DS1000CA Series...
Page 84
Function Explanation: This command is used to set the on-state for trigger system and its menu. Repeating the command would make this function switched between ON and OFF. 22. :KEY:Trig%50 Command Format: :KEY:Trig%50 Function Explanation: 2-72 Programming Guide for DS1000CA Series...
Page 85
This command is used to move the waveform display down gradually. 26. :KEY:V_SCALE_INC Command Format: :KEY:V_SCALE_INC Function Explanation: This command is used to increase the vertical scale of the current channel with the 1-2-5 step sequence. 2-73 Programming Guide for DS1000CA Series...
Page 86
This command is used to increase the horizontal scale of the current channel with the 1-2-5 step sequence. 30. :KEY:TRIG_LVL_INC Command Format: :KEY:TRIG_LVL_INC Function Explanation: This command is used to increase the trigger level gradually. 2-74 Programming Guide for DS1000CA Series...
Page 87
This command is used to decrease the horizontal offset of the current channel with gradually. 34. :KEY:PROMPT_V Command Format: :KEY:PROMPT_V Function Explanation: This command is used to switch the vertical scale between Coarse and Fine. Coarse step sequence is 1-2-5, Fine is to adjust gradually. 2-75 Programming Guide for DS1000CA Series...
Page 88
This command is used to increase the offset of the multi-function knob. (Equivalent turning the knob clockwise) 38. :KEY:-FUNCtion Command Format: :KEY:-FUNCtion Function Explanation: This command is used to decrease the offset of the multi-function knob. (Equivalent turning the knob anti-clockwise) 2-76 Programming Guide for DS1000CA Series...
Page 89
This command is used to adjust the trigger level to the central position of the screen. 42. :KEY:OFF Command Format: :KEY:OFF Function Explanation: This command is used to turn off CH1, CH2, MATH and REF keys one by one. 2-77 Programming Guide for DS1000CA Series...
:CURSor:MANUal:TYPE :CURSor:MANUal:SOURce :CURSor:MANUal:CURAX :CURSor:MANUal:CURAY :CURSor:MANUal:CURBX :CURSor:MANUal:CURBY :CURSor:TRACk:SOURceA :CURSor:TRACk:SOURceB :CURSor:TRACk:CURA :CURSor:TRACk:CURB :CURSor:TRACk:CURAY? :CURSor:TRACk:CURBY? The detailed information of each command are given as follows: 2-78 Programming Guide for DS1000CA Series...
Page 91
The commands are used to set and query cursor type as “TIME” or “AMPlitude” in manual mode. Returned Format: Query returns TIME or AMPlitude. Example: :CURS:MANU:TYPE TIME Set cursor type as “TIME” :CURS:MANU:TYPE? Query returns TIME :CURSor:MANUal:SOURce Command Format: 2-79 Programming Guide for DS1000CA Series...
Page 92
The range of <value> is 4~297. Returned Format: Query returns the set value of <value>. Example: :CURS:MANU:CURAX 100 Set position of cursor AX as 100 :CURS:MANU:CURAX? Query returns 100 :CURSor:MANUal:CURAY Command Format: :CURSor:MANUal:CURAY <value> :CURSor:MANUal:CURAY? 2-80 Programming Guide for DS1000CA Series...
Page 93
Set position of cursor BX as 100 :CURS:MANU:CURBX? Query returns 100 :CURSor:MANUal:CURBY Command Format: :CURSor:MANUal:CURBY <value> :CURSor:MANUal:CURBY? Function Explanation: This command is used to set and query the position of BY in manual mode. 2-81 Programming Guide for DS1000CA Series...
Page 94
Query returns CHANnel1 :CURSor:TRACk:SOURceB Command Format: :CURSor:TRACk:SOURceB <source> :CURSor:TRACk:SOURceB? Function Explanation: This command is used to set and query the measure channel tracked by cursor B in track mode. The options of <source> are “CHANnel1”, “CHANnel2”, 2-82 Programming Guide for DS1000CA Series...
Page 95
Query returns 100 11. :CURSor:TRACk:CURB Command Format: :CURSor:TRACk:CURB <value> :CURSor:TRACk:CURB? Function Explanation: The commands are used to set and query the position of cursor B in track mode. The range of <value> is 4~297. 2-83 Programming Guide for DS1000CA Series...
Page 96
Query returns the position of cursor AY within 4~194. 13. :CURSor:TRACk:CURBY? Command Format: :CURSor:TRACk:CURBY? Function Explanation: This command is used to set and query the position of cursor BY in track mode. Returned Format: Query returns position of cursoe BY within 4~194. 2-84 Programming Guide for DS1000CA Series...
Other Commands include: :INFO:LANGuage :COUNter:ENABle :BEEP:ENABle :BEEP:ACTion The detailed information of each command are given as follows: 2-85 Programming Guide for DS1000CA Series...
Page 98
The commands are used to set and query the frequency counter function”ON” or “OFF”. Returned Format: Query returns “ON” or “OFF”. Example: :COUN:ENAB ON Set the frequency counter function ”ON” :COUN:ENAB? Query returns “ON” 2-86 Programming Guide for DS1000CA Series...
Page 99
Example: :BEEP:ENAB ON Set the beeper ”ON” :BEEP:ENAB? Query returns “ON” :BEEP:ACTion Command Format: :BEEP:ACTion Function Explanation: This command is able to make a beep once (no matter whether it is opern or not). 2-87 Programming Guide for DS1000CA Series...
For more details, please refer to NI-VISA help. A typical application of VISA contains the fowling parts: Set up the conversation for the existing resource Configure the resource (such as: Baud rate) Close the conversation Programming Guide for DS1000CA Series...
Here we install it in the default path: C:\Program Files\IVI Foundation\VISA. Both USB and RS232 ports can be used to achiece communication between DS1000CA series digital oscilloscopes and PC. 1. By RS232 Please use RS232 cable to connect RS232 port on the rear panel of DS1000CA with PC.
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 OK. Choose Project → Settings → Link, add the file “visa32.lib” manually in Object/library modules. Programming Guide for DS1000CA Series...
Page 104
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. The blank Note: At present, VISA library has been added successfully. Add controls: Text, Com box, Button and Edit. See the figure below. Programming Guide for DS1000CA Series...
Page 105
Choose General in the property of Edit and select Disable. Modify the name of Button such as: Send and Read. Respectively add two variables m_combox and m_receive for the controls of Com box and Edit. Programming Guide for DS1000CA Series...
Page 106
[256] = {0}; CString s,strTemp; char* stringTemp; ViChar buffer [VI_FIND_BUFLEN]; ViRsrc matches=buffer; ViUInt32 nmatches; ViFindList list; viOpenDefaultRM (&defaultRM); // acquire USB resource of visa viFindRsrc(defaultRM, "USB?*", &list,&nmatches, matches); viOpen (defaultRM,matches,VI_NULL,VI_NULL,&vi); viPrintf (vi, "*RST\n"); Programming Guide for DS1000CA Series...
Page 107
Save, build and run the project, you will get an EXE file. When the oscilloscope has been successfully connected with PC, choose a command such as *IDN? and click “Send and Read”, the oscilloscope will return the result. Programming Guide for DS1000CA Series...
(CH1 and CH2).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. Choose Project→Project1 Properties→General, select “Form1” from the drop down box of Startup Object. Programming Guide for DS1000CA Series...
Page 109
Call viClose(defrm) 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 DS1000CA Series...
Page 110
“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”; right-click the mouse to choose Create→Control. See the figure below. 3-10 Programming Guide for DS1000CA Series...
Page 111
Waveform Graph control. See the figure below. Open LabVIEW Block Diagram; right-click and choose “Programming”→“String”→ “String/Array/Path” and select “String To Byte Array”; then, use this function to connect “read buffer” on “VISA Read” function Programming Guide for DS1000CA Series 3-11...
Page 112
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. 3-12 Programming Guide for DS1000CA Series...
Page 113
Programming Example RIGOL After you set the “Start” event, see the result below. Add a While Loop; add “Boolean”→“True Constant” to point the event of the “Stop” button to While and exit*. Programming Guide for DS1000CA Series 3-13...
Page 114
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. (the oscilloscope has been properly connected) 3-14 Programming Guide for DS1000CA Series...
Page 115
Programming Example RIGOL Programming Guide for DS1000CA Series 3-15...
Page 116
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 OK. Choose Project → Settings → Link, add the file “visa32.lib” manually in Object/library modules. 3-16 Programming Guide for DS1000CA Series...
Page 117
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. The blank Note: At present, VISA library has been added successfully. Add controls: Text, Com box, Button and Edit. See the figure below. Programming Guide for DS1000CA Series 3-17...
Page 118
Choose General in the property of Edit and select Disable. Modify the name of Button such as: Send and Read. Respectively add two variables m_combox and m_receive for the controls of Com box and Edit. 3-18 Programming Guide for DS1000CA Series...
Page 119
ViUInt32 nmatches; ViFindList list; //1. Open device Manager viOpenDefaultRM (&defaultRM); //2. Acquire RS232 resource of visa viFindRsrc(defaultRM, "ASRL?*", &list,&nmatches, matches); //Open serial device viOpen (defaultRM,matches,VI_NULL,VI_NULL,&vi); //4.Set up attribute of serial bus viSetAttribute (vi, VI_ATTR_TMO_VALUE, 5000); Programming Guide for DS1000CA Series 3-19...
Page 120
(3) During reading data by serial port, system will stop rading data when VISA meets end mark “0x0A”. Please note this phenomenon when appears 0x0A. In addition, length of reading data is a standard to judge whether data aception is over. 3-20 Programming Guide for DS1000CA Series...
Need help?
Do you have a question about the DS1000CA Series and is the answer not in the manual?
Questions and answers