RIGOL DS1000B User Manual

RIGOL
Programming Guide
DS1000B Series Digital Oscilloscope
DS1204B/DS1104B/DS1074B
Feb. 2014
RIGOL
I

Guaranty and Declaration

Copyright
© 2008 RIGOL Technologies, Inc. All Rights Reserved.
Trademark Information
RIGOL is regis t ered tradema rk of RIGOL Technologies, Inc.
Publication Number
PGA04109-1110
Notices
RIGOL products are protected by patent law in and outside of P.R.C.. RIGOL Technologies, In c . reserves the right to modify or ch a nge parts of or all
the specifications and pricing policies at company’s sole decision.
Information in this publication replaces all previously corresponding material. RIGOL shall not be liable for losses caused by either incidental or consequenti al
in connection with the furnishing, use or performance of this manual as well as any information contained. Any part of this document is forbidden to copy or photocopy or re arrange without prior written approval of RIGOL.
Product Certification
RIGOL guar antees thi s p roduct conf orms to the nati onal and in dustrial st andar ds in China as well as the ISO9001:2008 standard and the ISO14001:2004 standard. Other international standard conformance certification is in progress.
Contact Us
If you have any problem or requirement when using our produc ts or this manual, please contact RIGOL. E-mail: service@rigol.com Website: www.rigol.com
Programming Guide for DS1000B Series
RIGOL
II
Content
Chapter 1 Programming Introduction .................................................. 1-1
Communication Interface ......................................................................... 1-2
Command Introduction ............................................................................ 1-3
Command Syn tax ............................................................................. 1-3
Symbol Desc ri pt ion ........................................................................... 1-4
Command I nput ............................................................................... 1-5
Parameter Type ................................................................................ 1-6
Chapter 2 Command Systems .............................................................. 2-1
General Commands ................................................................................. 2-2
SYSTem Commands................................................................................. 2-5
ACQuire Commands ............................................................................... 2-12
DISPlay Commands ................................................................................ 2-15
TIMebas e Co mm ands ............................................................................. 2-21
TRIGger Comma nds ............................................................................... 2-26
Trigger Control ................................................................................ 2-28
EDGE Trigger .................................................................................. 2-34
PULSe Trigger ................................................................................. 2-35
VIDEO Trigger ................................................................................. 2-36
PATTern Trigger ............................................................................... 2-38
ALTernation Trigger .......................................................................... 2-39
MATH Commands ................................................................................... 2-48
CHANnel Commands .............................................................................. 2-50
MEASure Commands .............................................................................. 2-57
WAVeform Command s ............................................................................ 2-69
KEY Commands ..................................................................................... 2-79
SAVe/RECall Commands .......................................................................... 2-97
MASK Command s ................................................................................. 2-103
CURSor Commands .............................................................................. 2-109
Other Commands ................................................................................. 2-116
Chapter 3 Programming Examples ....................................................... 3-1
Prepare for Programming ......................................................................... 3-2
Program in Visual C++ 6.0 ....................................................................... 3-3
Programming Guide for DS1000B Series
RIGOL
III
Program in Visual Basic 6.0 ...................................................................... 3-8
Program in L abVIEW 8.6 ........................................................................ 3-10
Appendix: Command Quick Reference A-Z ................................................. 1
Programming Guide for DS1000B Series
Programming Introduction RIGOL
1-1

Chapter 1 Programming Introduction

This chapter provides guidance to the remote control programming of the DS1000B series digital oscilloscopes and introduction of the commands.
This chapter includes:
Communication Interface Command Introduction
Command Syntax Symbol Description Command Input Parameter Type
Command Input
Programming Guide for DS1000B Series
RIGOL Programming Introduction
1-2

Communication Interface

Computers can communicate with the oscilloscope by sending and receiving messages over USB or LAN interface. Commands in the form of ASCII character strings are embedded in your computer to make control easier.
Operations that you can do with a computer and the oscilloscope include:
Set up the oscilloscope; Relational measurements; Acquire data (wav e forms or measureme nt data) from the oscilloscope.
Equipment Connection:
USB: Use an USB data cable and connect the USB Device port on the rear panel
of the oscilloscope to PC.
LAN: Use a network cable and connet the oscilloscope t o LAN.
Programming Guide for DS1000B Series
Programming Introduction RIGOL
1-3

Command Introduction

Command Syntax

The commands system of DS1000B series oscilloscope is a multistage tree structure, and each of sub-system is consists of a “Root” keyword and multilayered keywords. The commands are always begin with a “:”(except for IEEE commands) and the keywords are also separated by “:”; optional parameters are permitted to follow the keywords; “?” appeared following a command line denotes to query this function; besides, “space” is used to divide command and parameter.
For example: :TRIGger:EDGE:SLOPe {POSitive|NEGative|ALTernation} :TRIGger:EDGE:SLOPe?
TRIGger is the root keyword of the command, EDGE and SLOPe is separately its second and th i rd keyword , a l l of them are se parated by “:”. Connects enclosed in the “{}” denote the parameters permitted to be set by user; “?” denotes t o query; the command :TRIGger:EDGE:SLOPe is set apart from parameter using “space”. “,” is used to compart the parameters existed in some commands, for example: :TRIGger:PATTern:PATTern <value>,<mask>,<ext source>[,<edge source>,<edge>]
Programming Guide for DS1000B Series
RIGOL Programming Introduction
1-4

Symbol Description

The followin g symbols are not “real” parts of the co mmands, but they are usua lly used to assist to explain the parameters containd in a command line.
1. Braces { }
The parameters or contents enclosed in “{}” must be selected, and only one parameter or content could be selected once. All the options are separated by “|”. For ex ampl e: {{1|ON}|{0|OFF}} indicateds th a t 1, ON, 0 or OFF can be se lecte d at a time.
2. Square brackets [ ]
Some keywords or contents are enclosed by square bracket “[ ]”, which indicates that those parameters are optional and will be execute no matter whether been omitted or not. For ex ampl e: :TIMebase[:MAIN]:OFFSet <offset> [:MAIN] can be omitted.
3. Triangle Brackets < >
Parameter enclosed in “< >” should be replace d by a effective value. For ex ampl e: :DISPlay:BRIGhtness <ncount> replaced by an effective value: :DISPlay:BRIGhtness 80
Programming Guide for DS1000B Series
Programming Introduction RIGOL
1-5

Command Input

All the coman ds a re not se nsitive to both capital letter and lowercase, so y ou can use any kind of them. But if use abbreviation, the capital letters specified in commands must be written completely. For ex ampl e:
:TRIGger:ALTernation:SOURce
also can be: :TRIG:ALT:SOUR or :trig:alt:sour
Programming Guide for DS1000B Series
RIGOL Programming Introduction
1-6

Parameter Type

The commands contains 5 kinds of parameters, different parameters has different setting methods.
1. Boolean
The parameter should be “OFF”, “ON”, “0” or “1”. For example : :DISPlay:PERSist {{1|ON}|{0|OFF}} “ON” and “1” denotes trun on (enable) the function, “OFF” and “0” denotes turn off (disable) the fucntion.
2. Consecutive Integer
The parameter should be a consecutive integer. For example: :DISPlay:BRIGhtness <ncount> <ncount> could be the i nteger bet ween 0 and 100 (i ncluding 0 and 100).
3. Consecutive Real Number
The parameters can be any value only in effective range precision permitting. For ex ampl e: :TRIGger:SENSitivity <count> <count> could be any value between 0.1 and 1 (including 0.1 and 1).
4. Discrete
The parameters can only be the cited value. For example: :ACQuire:AVERages <count> <count> could only be 2, 4, 8, 16, 32, 64, 128, 256.
5. ASCII Character String
The parameter should be composed of ASCII character string. For e xample: :TRIGger:MODE <mod> <mod> cou ld be EDGE, PULSe, VIDEO, PATTern or ALTernation.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-1

Chapter 2 Command Systems

In this chapter, we will introduce every comand in the DS1000B comm a nd systems. The introduction inludes command format, function description, query/Returned Format and some other notices that should pay attention to during using the commands.
DS1000B series support the following command subsystems:
General Command SYSTem Command ACQuire Command DISPlayDISPlay Command TIMebase Command
TRIGger Command
Trigger Control EDGE Trigger PULS e Trigger VIDEO Trigger PATTern Trigger ALTernation Trigger
MATH Command CHANnel Command MEASure Command WAVeform Command KEY Comm a nd SAVe/RECall Command MASK Command CURSor Command Other Command
Programming Guide for DS1000B Series
RIGOL Command Systems
2-2

General Commands

IEEE Standards have defined some general commands which are applied to query basic information of the instrument or perform elementary operations. These commands always have 3 characters and with a “*” marker.
DS1000B series support the following General Commands:
*IDN? *RST *LRN? *OPC?
We will give detailed introductions for each command in the following parts.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-3
1. *IDN? Command For ma t:
*IDN?
Function:
The command queries the manufacturer, the oscilloscope model, the product serial and the software version.
Returned Format:
manufacturer, <model>, <serial>, <version>.
Example:
Rigol Technologies, DS1204B, DS10000000, 00. 02 . 04.
2. *RST Command For ma t:
*RST
Function:
The command resets the system.
3. *LRN? Command For mat:
*LRN?
Function:
The command queries the system settings.
Returned Format: The query returns the data of system settings in the form of a self-defined character string which could be downloaded to do the same settings in the future.
Programming Guide for DS1000B Series
RIGOL Command Systems
2-4
4. *OPC? Command For ma t:
*OPC?
Function:
The command queries whether the command opera t ion has been com plet ed.
Returned Format:
The query returns 0 or 1 . 1 means o per ation has be en com pleted, 0 means no t.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-5

SYSTem Commands

SYSTem Commands are used for the basic operations of an os cillos co pe: R UN /STOP control, operation of the error queue and system setup data.
SYSTem Commands include:
:RUN :STOP :AUTO :SYSTem:ERRor :SYSTem:SETup
We will give detailed introductions for each command in the following parts.
Programming Guide for DS1000B Series
RIGOL Command Systems
2-6
1. :RUN Command For ma t:
:RUN
Function:
Execute this command, the oscilloscope will start waveform sampling working. To stop working, exe cute :STOP command again.
2. :STOP Command For ma t:
:STOP
Function:
Execute this command, the oscilloscope will stop waveform sampling working. To restart w orking, execute :RUN command again.
3. :AUTO Command For ma t:
:AUTO
Function:
The command makes the oscilloscope tests all input waveforms and set the waveforms automatically to get the optimum conditions to display.
4. :SYSTem:ERRor Command For mat:
:SYSTem:ERRor :SYSTem:ERRor?
Function:
The command clears the queue of error information.
Returned Format:
Programming Guide for DS1000B Series
Command Systems RIGOL
2-7
The query returns the last error, such as “Undefined header”. If there is n o erro r, return “0, No error”.
For details about system error codes, please refer to page 2-8:
Programming Guide for DS1000B Series
RIGOL Command Systems
2-8
System Error Code
5. :SYSTem:SETup Command For ma t:
:SYSTem:SETup <setup_data> :SYSTem:SETup?
Function:
The command downloads the system setup data. <setup data> is a binary data that meets IEEE 488.2 # format.
Returned Format:
The query returns the value of system setup data.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-9
Error Code
Mnemonic Symbol
Error Description
System Error Code
Up to 10 errors can be record ed in the system error queu e. If not enough, the system will adopt FIFO manner to cover the original error record.
The SYST:ERR? Command is used to read the first error code in the form of “error code, error description”, so as to reduce the error number of error queue. For instance, if no error appears, the system will return: 0, No error.
Besides, the :SYST:ERR Command is able to clear error queue.
0 ERR_NONE, No error 1 ERR_SAME_SETTING, Same setting 2 ERR_INVALID_INPUT, Invalid input 3 ERR_LIMIT_SETTING, Setting limit 4 ERR_CH_OFFSET_LIMIT, Channel offset limit 5 ERR_CH_SCALE_LIMIT, Channel scale limit 6 ERR_CH_PROBE_LIMIT, Channel probe limit 7 ERR_CH_FILTER_LIMIT, Channel filter limit 8 ERR_TIME_OFFSET_LIMIT, Timebase offset limit 9 ERR_TIME_SCALE_LIMIT, Timebase scale limit 10 ERR_TIME_DELAYED_OFFSET_LIMIT, Timebase of timedelay offset limit 11 ERR_TIME_DELAYED_SCALE_LIMIT, Timebase of timedelay scale limit 12 ERR_TRIG_LEVEL_LIMIT, Trigger level limit 13 ERR_MATH_VERT_OFFSET_LIMIT, Math vertical offset limit 14 ERR_MATH_VERT_SCALE_LIMIT, Math vertical scale limit 15 ERR_FFT_VERT_SCALE_LIMIT, FFT vertical offset limit 16 ERR_FFT_VERT_OFFSET_LIMIT, FFT vertical offset limit 17 ERR_FFT_HORIZ_SCALE_LIMIT, FFT horizontal scale limit 18 ERR_FFT_HORIZ_OFFSET_LIMIT, FFT horizontal offset limit 19 ERR_CUR_A_X_LIMIT, CursorA X-Axial limit 20 ERR_CUR_B_X_LIMIT, CursorB X-Axial limit 21 ERR_CUR_A_Y_LIMIT, CursorA Y-Axial limit 22 ERR_CUR_B_Y_LIMIT, CursorB Y-Axial limit 23 ERR_HOLDOFF_TIME_LIMIT, Holdoff time limit 24 ERR_INTENSITY_LIMIT, Intensity limit 25 ERR_PULSE_WIDTH_LIMIT, Pulse width limit
Programming Guide for DS1000B Series
RIGOL Command Systems
2-10
26 ERR_VIDEO_LINE_LIMIT, Video line limit 27 ERR_REC_INTERVAL_LIMIT, Record interval limit 28 ERR_REC_END_FRAME_LIMIT, Record end frame limit 29 ERR_PLAY_INTERVAL_LIMIT, Play interval limit 30 ERR_PLAY_START_FRAME_LIMIT, Play start frame limit 31 ERR_PLAY_CUR_FRAME_LIMIT, Play current frame limit 32 ERR_PLAY_END_FRAME_LIMIT, Play end frame limit 33 ERR_STOARAGE_START_FRAME_LIMIT, Storage start frame limit 34 ERR_STOARGE_END_FRAME_LIMIT, Storage end frame limit 35 ERR_REF_VERT_OFFSET_LIMIT, Ref vertical offset limit 36 ERR_REF_VERT_SCALE_LIMIT, Ref vertical scale limit 37 ERR_PF_MASK_LIMIT, Passfail mask limit 38 ERR_SAMPLING_RATE_LIMIT, Sampling rate limit 39 ERR_GRID_INTENSITY_LIMIT, Grid intensity limit 40 ERR_TRIG_SENSITIVITY_LIMIT, Trigger sensitivity limit 41 ERR_TRIG_SLOPE_TIME_LIMIT, Trigger slop time limit 42 ERR_MEM_DEPTH_LIMIT, Memory depth limit 43 ERR_FUNCTION_NOT_AVAILABLE, Function not available 44 ERR_LOCATION_EMPTY, Location empty 45 ERR_MEAS_ALREADY_SELECTED, Measure already selected 46 ERR_NO_SIGNAL_FOUND, No signal found 47 ERR_WAVEFORM_RECORD_FINISHED, Waveform record finished 48 ERR_FILE_UTILITY_FAIL, File utility fail 49 ERR_CHANNEL_INVALID, Channel invalid 50 ERR_AUTO_KEY_LIMITED, Auto key limited 51 ERR_NOT_ENOUGH_MEMORY, Not enough memory 52 ERR_WAVE_SAVE_FAILED, Waveform save failed 53 ERR_WAVE_LOAD_FAILED, Waveform load failed 54 ERR_FILE_IS_COVERED, File is covered 55 ERR_FILTER_IS_CLOSED, Filter is closed 56 ERR_WAVE_TYPE_NONE, No signal detected 57 ERR_WAVE_TYPE_DC, DC signal detected 58 ERR_WAVE_TYPE_SINE, Sine signal detected 59 ERR_WAVE_TYPE_RAMP, Triangle signal detected 60 ERR_WAVE_TYPE_RECT, Square signal detected 61 ERR_WAVE_TYPE_UNKNOWN, Unknown signal detected 62 CMD_ERR, Error header 63 CMD_NOT_PARSE, Undefined header
Programming Guide for DS1000B Series
Command Systems RIGOL
2-11
64 ERR_PF_OUTPUT, PassFail Out 65 ERR_MISSING_HW, Missing Hardware 66 ERR_OUT_OF_RANGE Out of range
67 ERR_CANNOT_EXECURE Can’ t execute
Programming Guide for DS1000B Series
RIGOL Command Systems
2-12

ACQuire Commands

ACQuire Commands are used to set the acquisition mode for oscilloscope. ACQuire Commands include:
:ACQuire:TYPE :ACQuire:MODE :ACQuire:AVERages :ACQuire:SRATe?
We will give detailed introductions for each command in the following parts.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-13
1. :ACQuire:TYPE Command For ma t:
:ACQuire:TYPE <type> :ACQuire:TYPE?
Function:
The command sets the acquisition type. The <type>may be NORMal(common sample), AVERage(average sample) or PEAKdetect(peak detection).
Returned Format:
The query returns Normal or AVERAGE, PEAKDETECT.
Example:
:ACQ:TYPE AVERage Set the acquisition type as average acquisition. :ACQ:TYPE? Return AVERAGE.
2. :ACQuire:MODE Command For ma t:
:ACQuire:MODE <mode> :ACQuire:MODE?
Function:
The command sets the acquisit ion mode. The <mode> may be RT IMe (real time sample) or ETIMe (equal time sample).
Returned Format:
The query returns RTIME or ETIME.
Example:
:ACQ:MODE ETIM Set the acquisition mode as equal time acquisition. :ACQ:MODE? Return ETIME.
3. :ACQuire:AVERages Command For ma t:
Programming Guide for DS1000B Series
RIGOL Command Systems
2-14
:ACQuire:AVERages <count> :ACQuire:AVERages?
Function:
The command sets the average acquisition time. The <count> range is 2~256, and the count increases by the power operation of 2.
Returned Format:
The query returns 2 or 4, 8, 16, 32, 64, 128, 256.
Example:
:ACQ:AVER 16 Set the average acquisition time as 16. :ACQ:AVER? Return 16.
4. :ACQuire:SRATe? Command For ma t:
:ACQuire:SRATe? [{<CHANnel<n>}]
Function
To query sample rate of CHANnel <n>, <n> may be 1, 2, 3, 4.
Returned Format:
The query returns 5.000e005, the unit is Sa/s.
Programming Guide for DS1000B Series
Command Systems RIGOL
2-15

DISPlay Commands

DISPlay Commands are used to set the display system. DISPlay Commands include:
:DISPlay:TYPE :DISPlay:GRID :DISPlay:PERSist :DISPlay:MNUDisplay :DISPlay:MNUStatus :DISPlay:SCReen :DISPlay:CLEar :DISPlay:BRIGhtness :DISPlay:INTensity :DISPlay:DATA?
We will give detailed introductions for each command in the following parts.
Programming Guide for DS1000B Series
RIGOL Command Systems
2-16
1. :DISPlay:TYPE Command For ma t:
:DISPlay:TYPE <type> :DISPlay:TYPE?
Function:
The command sets the display type of acquisition points. The <type> may be VECTors (acquisition point s are conne cted by lines) or DOTS (acquisition points are displayed by dots).
Returned Format:
The query returns VECTORS or DOTS.
Example:
:DISP:TYPE VECT Set the disp l ay type a s vect ors. :DISP:TYPE? Ret urn VECTORS.
2. :DISPlay:GRID Command For ma t:
:DISPlay:GRID <grid> :DISPlay:GRID?
Function:
The command sets the display type of screen grid. The <grid> may be FULL (grid and coordinate are shown), HALF (grid is not shown) or NONE (grid and coordinate are not shown).
Returned Format:
FULL or HALF, NONE.
Example:
:DISP:GRID FULL Make grid and coordinate shown. :DISP:GRID? Return FULL.
3. :DISPlay:PERSist
Programming Guide for DS1000B Series
Command Systems RIGOL
2-17
Command For ma t: :DISPlay:PERSist {{1|ON}|{0|OFF}} :DISPlay:PERSist?
Function:
The command sets waveform persist f unction ON (The wavefor m is shown until waveform persist function is off or relevant settings are changed.) or OFF (The waveform is updated as high refresh rate).
Returned Format:
The query returns 1 or 0, respectively indicates ON or OFF.
Example:
:DISP:PERS ON Set waveform persist function on. :DISP:PERS? Return 1.
4. :DISPlay:MNUDisplay Command For mat:
:DISPlay:MNUDisplay <time> :DISPlay:MNUDisplay?
Function:
The command sets the display time of menu. The menu will hide after the display time. The <ti me> ma y be 1s, 2s , 5s, 10s, 2 0s or IN Finite (dis play all th e time).
Returned Format:
The query returns 1s or 2s, 5s, 10s, 20s, Infinite.
Example:
:DISP:MNUD 10s Set the display time as 10s. :DISP:MNUD? Return 10s.
5. :DISPlay:MNUStatus Command For ma t:
Programming Guide for DS1000B Series
RIGOL Command Systems
2-18
:DISPlay:MNUStatus {{1|ON}|{0|OFF}} :DISPlay:MNUStatus?
Function:
The command sets menu display function ON (Performing menu operation) or OFF (viewing the waveform).
Returned Format:
The query returns 1 or 0, respectively indicates ON or OFF.
Example:
:DISP:MNUS ON Set menu display function on. :DISP:MNUS? Return 1.
6. :DISPlay:SCReen Command For mat:
:DISPlay:SCReen <scr> :DISPlay:SCReen?
Function:
The command sets the display mode of screen. The <scr>may be NORMal (normal display mode ) or INVerted (inverted di s pl ay mode).
Returned Format:
The query returns NORMAL or INVERTED .
Example:
:DISP:SCR NORM Set the screen as normal display mode. :DISP:SCR? Return NORMAL.
7. :DISPlay:CLEar Command For ma t:
:DISPlay:CLEar
Function:
Programming Guide for DS1000B Series
Loading...
+ 122 hidden pages