GW Instek GDS-800 User Manual

GDS-806/810/820/840 Programming Manual
Table of Contents Pages
1. INTRODUCTION................................................................................................................... 2
2. COMPUTER’S CONNECTION............................................................................................. 6
3. REMOTE CONTROL'S COMMANDS................................................................................ 12
4. DETAILS OF COMMAND REFERENCE ........................................................................... 19
5. STATUS REPORTS............................................................................................................ 73
7. APPENDIX A: HOW CAN WE CONVERT THE HEXADECIMAL FORMAT TO A
FLOATING POINT FORMAT. ................................................................................................ 89
Due to continuous improvements in the GDS-806/810/820/840 Digital Storage Oscilloscope, information contained in this manual is subject to change without notice. Contact GOOD WILL, for revisions and corrections.
GOOD WILL Instrument Co., LTD.
No.7-1, Jhongsing Rd., Tucheng City,
Taipei County 236, Taiwan
Telephone – 886-2-22680389 Fax – 886-2-22680639
E-mail - marketing@goodwill.com.tw
http://www.goodwill.com.tw
0
GDS-806/810/820/840 Programming Manual
1. Introduction
Users can drive this digital storage oscilloscope by using the GPIB (General Purpose Interface Bus) system with a computer, or from a computer across the
RS-232 serial connection. Commands sent over either interface can read or set any oscilloscope’s instructions. This chapter explains how to carry out the following tasks.
Notes for GPIB installation
If you are setting up the oscilloscope with a GPIB system, please check the following regulations:
z Only a maximum of 15 devices can be connected to a single GPIB bus.
z Do not use more than 20 m of cable to connect devices to a bus.
z Connect one device for every 2 m of cable used.
z Each device on the bus needs a unique device address. No two devices can
share the same device address.
z Turn on at least two-thirds of the devices on the GPIB system while you use the
system.
z Do not use loop or parallel structure for the topology of GPIB system.
1
GDS-806/810/820/840 Programming Manual
Notes for RS-232 Configuration
This oscilloscope contains a DB 9-pin, male RS-232 connector for serial communication with a computer or terminal. The RS-232 interface of this oscilloscope is configured as an RS-232 “Data Terminal Equipment”, so that data is sent from pin 3 and received on pin 2. For remote controls, the RS-232 interface has to be connected with a computer or terminal.
Pin Assignments
The pin assignments for RS-232 interface of the oscilloscope are listed below.
1. No connection
2. Receive Data(RxD) (input)
3. Transmit Data(TxD) (output)
4. No connection
5. Signal Ground (GND)
6. No connection
7. No connection
8. No connection
9. No connection
Figure 1-1: Pin assignments for the RS232 connector
DB9 to DB9 Wiring
The wiring configuration is used for computer with DB9 connectors that configured as Data Terminal Equipment.
Oscilloscope
(DB9, DTE)
Pin2 Pin3
Figure 1-2: DB9 to DB9 wiring
Computer
(DB9, DTE)
Pin2 Pin3 Pin5Pin5
2
GDS-806/810/820/840 Programming Manual
When the oscilloscope is set up with a RS-232 interface, please check the following points:
z Do not connect the output line of one DTE device to the output line of the
other.
z Many devices require a constant high signal on one or more input pins. z Ensure that the signal ground of the equipment is connected to the signal
ground of the external device.
z Ensure that the chassis ground of the equipment is connected to the
chassis ground of the external device.
z Do not use more than 15m of cable to connect devices to a PC. z Ensure the same configurations are used on the device as the one used
on PC terminal.
z Ensure the connector for the both side of cable and the internal
connected line are met the demand of the instrument.
Computer’s Connection for RS-232
A personal computer with a COM port is the essential facilities in order to operate the digitizing oscilloscope via RS-232 interface.
The connections between oscilloscope and computer are as follows:
I. Connect one end of a RS-232 cable to the computer.
II. Connect the other end of the cable to the RS-232 port on the oscilloscope.
III. Turn on the oscilloscope.
IV. Turn on the computer.
Figure 1-3, shows the GPIB port and RS-232 port’s locations on the rear panel of the oscilloscope.
3
GDS-806/810/820/840 Programming Manual
Figure 1-3. Rear panel of the oscilloscope
(1): Main power switch (2): AC power socket (3): GPIB port (option for all series oscilloscopes) (4): Fuse drawer (5): “SELF CAL” BNC output (6): “GO/NO GO” BNC output (option for GDS-806/810) (7): USB connector (option for GDS-806/810) (8): Printer port (option for GDS-806/810) (9): RS-232 port
4
GDS-806/810/820/840 Programming Manual
2. Computer’s Connection
A personal computer with a GPIB card is the essential stuff in order to operate the oscilloscope via GPIB interface.
The connections between oscilloscope and computer are following:
I. Connect one end of a GPIB cable to the computer.
II. Connect the other end of the GPIB cable to the GPIB port on the Oscilloscope.
III. Turn on the oscilloscope.
IV. Turn on the computer.
The GPIB interface capabilities:
The GPIB interface of the oscilloscope corresponds to the standard of IEEE488.1­1987, IEEE488.2-1992 and SCPI-1994. The GPIB interface functions are listed as follows:
SH1 (Source Handshake):
AH1 (Acceptor Handshake):
T6 (Talker): Talker interface function includes basic talker, serial
L4 (Listener): The oscilloscope becomes a listener when the
The oscilloscope can transmit multilane messages across the GPIB.
The oscilloscope can receive multilane messages across the GPIB.
poll, and un-address if MLA capabilities, without talk only mode function.
controller sends its listen address with the ATN (attention) line asserted. The oscilloscope does not have listen only capability.
5
GDS-806/810/820/840 Programming Manual
SR0 (Service Request): The oscilloscope has no SRQ (Service request)
function.
RL2 (Remote/Local): The oscilloscope will ignore the LLO (local lockout)
command.
PP0 (Parallel Poll): The oscilloscope has no Parallel Poll interface
function.
DC1 (Device Clear): The oscilloscope has Device clear capability to return
the device to power on status.
DT0 (Device Trigger): The oscilloscope has no Device Trigger interface
function.
C0 (Controller) : This oscilloscope can not control other devices.
The GPIB address setting
To change the GPIB address, please use the following steps:
z Press the UTILITY button on the front panel. The utility menu provides
Interface Menu sub menu by pressing F2 softkey which GPIB sub menu is included. Press F1 softkey to select GPIB setting menu.
For GPIB sub menu
z Type GPIB: Select GPIB port. z Addr 1~30 z Previous Menu: back to previous menu.
: select the appropriate address for GPIB.
6
GDS-806/810/820/840 Programming Manual
The GPIB connection testing
If you want to test the GPIB connection is whether working or not, use the National Instrument’s “Interactive Control utility” for instance, you communicate with the GPIB devices through calls you interactively type in at the keyboard.
The Interactive Control can help you to learn about the instrument and to troubleshoot problems by displaying the following information on your screen after you enter a command:
z Results of the status word (ibsta) in hexadecimal notation
z Mnemonic constant of each bit set in ibsta
z Mnemonic value of the error variable (iberr) if an error exists (the ERR bit is
set in ibsta)
z Count value for each read, write, or command function
z Data received from your instrument
You can access online help in Interactive Control by entering help at the prompt, or you can get help on a specific function by entering help <function> at the prompt, where <function> is the name of the function for which you want help.
To start Interactive Control within National Instrument’s “Measurement & Automation Explorer”, complete the following steps:
1. Select ToolsI-488.2 UtilitiesInteractive Control.
2. Open either a board handle or device handle to use for further NI-488.2 calls. Use ibdev to open a device handle, ibfind to open a board handle, or the set
488.2 command to switch to a 488.2 prompt.
7
GDS-806/810/820/840 Programming Manual
The following example uses ibdev to open a device, assigns it to access board gpib0, chooses a primary address of 7 with no secondary address, sets a timeout of 10 seconds, enables the END message, and disables the EOS mode.
:ibdev enter board index: 0
enter primary address: 7 enter secondary address: 0 enter timeout: 13 enter ‘EOI on last byte’ flag: 1 enter end-of-string mode/byte: 0
ud0:
Note: If you type a command and no parameters, Interactive Control prompts you for the necessary arguments. If you already know the required arguments, you can type them at the command prompt, as follows:
:ibdev 0 7 0 13 1 0 ud0:
Note: If you do not know the primary and secondary address of your GPIB instrument, right-click on your GPIB interface in Measurement & Automation Explorer and select Scan for Instruments. After Explorer scans your interface, it displays your instrument address in the right window panel.
3. After you successfully complete ibdev, you have a ud prompt. The new prompt, ud0, represents a device-level handle that you can use for further NI-488.2 calls. To clear the device, use ibclr, as follows:
ud0: ibclr [0100] (cmpl)
8
GDS-806/810/820/840 Programming Manual
4. To write data to the device, use ibwrt. ud0: ibwrt "*IDN?" [0100] (cmpl)
count: 5
5. To read data from your device, use ibrd. The data that is read from the instrument is displayed. For example, to read 28 bytes, enter the following:
ud0: ibrd 28 [0100] (cmpl)
count: 28
47 57 2C 20 47 44 53 2D GW, GDS­38 32 30 2C 20 50 39 32 820, P92 30 31 33 30 2C 20 56 2E 0130, V. 31 2E 30 39 1.09
6. When you finish communicating with the device, make sure you put it offline using the ibonl command, as follows:
ud0: ibonl 0 [0100] (cmpl)
: The ibonl command properly closes the device handle and the ud0 prompt is no
longer available.
7. To exit Interactive control, type q.
For the details, please refer to National Instrument’s manual.
If you do not receive a proper response from the oscilloscope, please check the power is on, the GPIB address is correct, and all cable connections are active,
9
GDS-806/810/820/840 Programming Manual
The RS232 connection testing
If you want to test whether the RS-232 connection is working or not, you can send a command from computer. For instance, using a terminal program send the query command
*idn?
should return the Manufacturer, model number, serial number and firmware version in the following format:
GW,GDS-820,P920130,V.2.01
If you do not receive a proper response from the oscilloscope, please check if the power is on, the RS-232 configurations are the same on both sides, and all cable connections are active.
10
GDS-806/810/820/840 Programming Manual
3. Remote Control’s Commands
This oscilloscope can be operated from computer via the GPIB port or RS-232 port. The remote commands of this oscilloscope are compatible with IEEE-488.2 and SCPI standards partially.
SCPI
SCPI (Standard Commands for Programmable Instruments) is a standard that created by an international consortium of the major test and measurement equipment manufacturers. The IEEE-488.2 syntax has been adopted by SCPI to furnish common commands for the identical functions of different programmable instruments.
SCPI
Common Command & Queries
Syntax & Status Data Structure
Interface Function
AABBCCDD
SCPI
IEEE-488.2 IEEE-488.2
SCPIIEEE-488.1
Figure 3-1: the relationship between IEEE-488.1, IEEE-488.2, and SCPI.
11
GDS-806/810/820/840 Programming Manual
As shown in the figure 3-1, the IEEE-488.1 standard locates at layer A, the layer A is belonged to the protocol of interface function on the GPIB bus. The source handshake (SH), acceptor handshake (AH) and talker are included in this layer (10 interface functions totally). At layer B, the syntax and data structure could be the essence of entire IEEE-488.2 standard. The syntax defines the function of message communication, which contain the <PROGRAM MESSAGE> (or simply “commands”) and <RESPONSE MESSAGE>. The two kinds of messages are represented the syntax formation of device command and return value. The data structure is the constitution of status reporting, which IEEE-488.2 standard have been defined. The common commands and queries are included with layer C. Commands and queries can be divided into two parts: mandatory and optional. Commands modify control settings or tell the instrument to perform a specific action. Queries cause the instrument to send data or status information back to the computer. A question mark at the end of a command identifies it as a query. Layer D is interrelated with device information. Different devices have different functions. SCPI command sets are belonged to this layer.
Command Syntax
If you want to transfer any of the instructions to an instrument, and comply with SCPI, there are three basic elements must be included.
z Command header z Parameter (if required) z Message terminator or separator
12
GDS-806/810/820/840 Programming Manual
Command Header
The command header has a hierarchical structure that can be represented by a command tree (Figure 3-2).
:TRIGger:
:DELay
:TIMe ? :TYPe
0 (Delay) 1 (event)
Figure 3-2: Tree hierarchy
:SLOP ?
Root node
Lower-
level
nodes
Leaf node
The top level of the tree is the root level. A root node is located at the root level. A root node and one or more lower-level nodes form a header path to the last node called the leaf node.
The command header is configured by header path and leaf node. Figure 3-3 shows the command header for the leaf node.
:TRIGger:DELay:EVENt ?
Root Node
Header Path
Command Header
Figure 3-3: Command header
Leaf Node
13
GDS-806/810/820/840 Programming Manual
Parameter
If the command has parameters, the values have to be included. In this manual, when we expressed the syntax of the command, the < > symbols are used for enclosing the parameter type. For instance, the syntax of the command in Figure 8-5 includes the Boolean parameter type
NOTE: Do not include the <, >, or | symbols when entering the actual value for a parameter.
:TRIGger:DELay:MODe <Boolean>
Parameter
Space
Figure 3-4: Command Header with Parameter
Type
Table 3-1 defines the Boolean and other parameter types for the oscilloscope.
Parameter Type Description Example
Boolean Boolean numbers or values 1
0 NR1 Integers 0, 1, 18 NR2 Decimal numbers 1.5, 3.141, 8.4 NR3 Floating point numbers 4.5E-1, 8.25E+1 NRf NR1, NR2, or NR3 1, 1.5, 4.5E-1
Table 3-1: Parameter Types for Syntax Descriptions
14
GDS-806/810/820/840 Programming Manual
For the actual value of the parameter type <Boolean>, you have to enter 0 instead of “OFF” or enter 1 instead of “ON”.
The following example includes both the header and a value for the parameter type:
:TRIGger:NREJ 0
Parameter values that appeared in this manual are often separated by a vertical line. This vertical line means the same thing as the word "or," For example, values for the parameter <Boolean> are
0|1
This is the same thing as saying "0 (off) or 1 (on)" Any single value is a valid parameter.
Message Terminator and Message Separator
In accordance with IEEE 488.2 standard, this oscilloscope accepts any of the following message terminators:
^
z LF
z LF
z <dab>
These terminators are compatible with most application programs.
A semicolon separates one command from another when the commands appear on the same line.
END Line feed code (hexadecimal 0A) with END message
Line feed code
^
END
Last data byte with END message
15
GDS-806/810/820/840 Programming Manual
Entering Commands
The standards that govern the command set for this oscilloscope allow for a certain amount of flexibility when you enter commands. For instance, you can abbreviate many commands or combine commands into one message that you send to the oscilloscope. This flexibility, called friendly listening, saves programming time and makes the command set easier to remember and use.
Command Characters
This oscilloscope is not sensitive to the case of command characters. You can enter commands in either uppercase or lowercase.
You can precede any command with white space characters. You must, however, use at least one space between the parameter and the command header.
Abbreviating Commands
Most commands have a long form and a short form. The listing for each command in this section shows the abbreviations in upper case. For instance, you can enter the query
:TIMebase:SCALe ?
simply as
:TIM:SCAL ?
16
GDS-806/810/820/840 Programming Manual
Combining Commands
You can use a semicolon (;) to combine commands and queries. This oscilloscope executes coherent commands in the order it receives them. When you coherent queries, the oscilloscope will combine the responses into a single response message with LineFeed (0A) for each command. For example, if the frequency and amplitude of the signal are equal to 100kHz and 1V, the command
:MEASure:FREQuency?;:MEASure:VAMPlitude?
returns the message
100kHz 1v
*: Please note that a LineFeed (0A) message terminator will be added behind each responded command.
Therefore the return message of “100kHz 1v” should be exact looked like as “100kHz 0A 1V 0A”
17
GDS-806/810/820/840 Programming Manual
4. Details of Command Reference
Each command in this chapter will give a brief description. The examples of each command will be provided and what query form might return.
*CLS (no query form)
Clears all event status data register. This includes the Output Queue, Operation Event Status Register, Questionable Event Status Register, and Standard Event Status Register.
Syntax
*CLS
Examples
*CLS clears all event registers.
*ESE
Sets or returns the bits in the Event Status Enable Register (ESER). The ESER enables the Standard Event Status Register (SESR) to be summarized on bit 5 (ESB) of the Status Byte Register (SBR).
Syntax
*ESE<NR1>
*ESE?
Arguments
<NR1> is a number from 0 to 255. The binary bits of the ESER are set according to this value.
Returns
<NR1> is a number from 0 to 255 that indicates the decimal value of the binary bits of the ESER.
18
GDS-806/810/820/840 Programming Manual
Examples
*ESE 65 sets the ESER to binary 0100 0001. If the ESER contains the binary value 1000 0010, the *ESE? will return the value of
130.
*ESR? (query only)
Returns and clears the contents of the Standard Event Status Register (SESR).
Syntax
*ESR?
Returns
<NR1> is a number from 0 to 255 that indicates the decimal value of the binary bits of the ESER.
Examples
If the ESER contains the binary value 1100 0110, the *ESR? will return the value of
198.
*IDN? (query only)
Returns the unique identification code of the oscilloscope.
Syntax
*IDN?
Examples
*IDN?
Returns GW,GDS-806/GDS-810/GDS-820/GDS-840,0,<Firmware version>
19
GDS-806/810/820/840 Programming Manual
*LRN? (query only)
Returns the string that the oscilloscope settings will be listed.
Syntax
*LRN?
Returns
*OPC?
The command form (*OPC) sets the operation complete bit (bit 0) in the Standard Event Status Register (SESR) when all pending operations finish.
The query form (*OPC?) tells the oscilloscope to place an ASCII 1 in the Output Queue when the oscilloscope completes all pending operations.
Syntax
*OPC
*OPC?
Returns
1
20
GDS-806/810/820/840 Programming Manual
*RCL
Recall the setting data from memory which previous saved. The settings of RS-232 (or GPIB) can be stored in memory of M1~M15. However, if users recall the stored memory which the settings of RS-232 or GPIB are different with present settings, the RS-232 (or GPIB) settings will keep with the present situation. The RS-232 (or GPIB) settings will not to be influenced by the recall setting of RS-232 (or GPIB) for this moment.
Syntax
*RCL <NR1>
Arguments: 1~15 Examples
*RCL 1 recalls the setting data which located at first position of memory address.
*RST (no query form)
Sets all control settings of oscilloscope to their default values but does not purge stored setting.
Syntax
*RST
*SAV
Saves the setting data to memory.
Syntax
*SAV <NR1>
Arguments
1~15
Examples
*SAV 2 saves the setting data to the second position of memory queue.
21
GDS-806/810/820/840 Programming Manual
*SRE
Setup the contents of the Service Request Enable Register (SRER). The query form returns the contents of the SRER. Bit 6 of the SRER is always zero. The bits on the SRER correspond to the bits on the SBR.
Syntax
*SRE <NR1>
*SRE?
Arguments
<NR1> is an integer from 0 to 255.
Returns
<NR1>
Examples
*SRE 7 sets bits of the SRER to 0000 0111. If the *SRE? returns 0000 0011, the setting of *SRE is 3.
*STB? (query only)
Query of the Status Byte register (SBR) with *STB? will return a decimal number representing the bits that are set (true) in the status register.
Syntax
*STB?
Returns
<NR1>
Examples
*STB? returns 81 if SBR contains the binary value 0101 0001.
22
GDS-806/810/820/840 Programming Manual
*WAI (no query form)
WAI prevents the programming instrument from executing further commands or queries until all pending operations finish.
Syntax
*WAI
:ACQuire:AVERage
Select the average number of waveform acquisition. The range for averaging is from 2 to 256 in powers of 2.
Note: Before implement this instrument, please apply “:ACQuire:MODe 2” in advance!
Syntax
:ACQuire:AVERage {1|2|3|4|5|6|7|8}
:ACQuire:AVERage?
Arguments
1Average number is 2 2Average number is 4 3Average number is 8 4Average number is 16 5Average number is 32 6Average number is 64 7Average number is 128 8Average number is 256
Returns
<NR1>
23
GDS-806/810/820/840 Programming Manual
:ACQuire:LENGth
Select the number of record length. This oscilloscope provides record length of 500, 1250, 2500, 5000, 12500, 25000, 50000, and 125000.
Syntax
:ACQuire:LENGth {0|1|2|3|4|5|6|7}
:ACQuire:LENGth?
Arguments
0Record length is 500 1Record length is 1250 2Record length is 2500 3Record length is 5000 4Record length is 12500 5Record length is 25000 6Record length is 50000 7Record length is 125000
Returns
<NR1>
:ACQuire:MODe
Select the waveform acquisition mode. There are four different acquisition mode: sample, peak detection, average and accumulate.
Syntax
:ACQuire:MODe {0|1|2}
:ACQuire:MODe?
Arguments
0Select the sample mode 1Select the peak detection mode
2Select the average mode
Returns
<NR1>
Note: Please select the specific acquire mode before implement any acquisition.
24
GDS-806/810/820/840 Programming Manual
:ACQuire<X>:MEMory? (query only) (Available for firmware 2.03 and above only) Transfer the total waveform data from the acquisition memory. (The memory
capacity can be selected as 500, 1250, 2500, 5000, 12500, 25000, 50000, or 125000 points. See Page 25 for details.)
Syntax
:ACQuire<X>:MEMory?
Arguments
<X>Specify the channel number (1|2)
Returns
The string of data is following.
Data size digit
#
Data size Sample rate Channel indicator Reserved data Waveform data
#: Begin a transmission of data string. Data size digit: Indicate the digits of following data string amount (1 digit). Data size: the amount of current data string (4, 5, or 6 digits). Next table lists the
relations between data size digit, data size and record length.
Data String
Begin a
transmission of
data string
Data size
digit
Data size
Record length Record length=500 # 4 1008 The rest of data Record length=1250 # 4 2508 The rest of data Record length=2500 # 4 5008 The rest of data Record length=5000 # 5 10008 The rest of data Record length=12500 # 5 25008 The rest of data Record length=25000 # 5 50008 The rest of data Record length=50000 # 6 100008 The rest of data Record length=125000 # 6 250008 The rest of data
25
GDS-806/810/820/840 Programming Manual
Sample Rate: Indicates the corresponding sample rate of received waveform data (4
bytes). The sample rate is indicated by floating point format which compatible with IEEE 754 standards.
Note: This block uses little-endian byte ordering. See Appendix A for more conversion information
Channel indicator: Show the channel which sent the waveform data (1 byte).
1→Channel one 2→Channel two
Reserved Data: Not used (3 bytes). Waveform data: Depends on the specify record length, the effective waveform data
which covers 500 points (1000 bytes), 1250 points (2500 bytes), 2500 points (5000 bytes), 5000 points (10000 bytes), 12500 points (25000 bytes), 25000 points (50000 bytes) , 50000 points (100000 bytes) or 125000 points (250000 bytes). Each point is composed by two bytes (the integer value of 16 bits). The high byte (MSD) will be prior transferred.
Example 1
Transfer the waveform data (sample rate = 100MSa/s) of channel 1 at 250000 points record length:
:ACQuire1:MEMory? The oscilloscope will return the following messages:
Note: Please select the specific memory length before implement any acquisition. See explanation for “:ACQuire:LENGth”.
26
GDS-806/810/820/840 Programming Manual
:ACQuire<X>:POINt (query only)
Transfer the displayed waveform data (always 500 points data totally) from the oscilloscope. Each point is composed by two bytes (the integer value of 16 bits). The high byte (MSD) will be prior transferred.
Syntax
:ACQuire<X>:POINt
Arguments
<X>Specify the channel number (1|2)
Returns
The string of data is following.
Data size digit
#
Data size Horizontal
scale
Channel indicator Waveform data size Waveform data
#: Begin a transmission of data string. Data size digit: Indicate the digits of following data string amount (1 digit). Data size: the amount of current data string (4 digits). Horizontal scale: The corresponding Horizontal scale of received waveform data (4
bytes). The Horizontal scale is indicated by floating point format which compatible with IEEE 754 standards.
Channel indicator: Show the channel which sent the waveform data. Waveform data size: The total amounts indicator of waveform data (4 bytes). Waveform data: The effective waveform data which covers 500 points (1000 bytes)
totally
Example
Transfer the waveform data of channel 1 at 250μs per division: :ACQuire1:POINt , the oscilloscope will return the following messages:
27
GDS-806/810/820/840 Programming Manual
:AUToset
Perform an automatic setup in order to optimize the acquisition parameters.
Syntax
:AUToset
:CHANnel<X>:BWLimit
Enable or disable the bandwidth limit function.
Syntax
:CHANnel<X>:BWLimit {0|1}
:CHANnel<X>:BWLimit?
Arguments
<X>Specify the channel number (1|2)
0Disable bandwidth limit 1Enable bandwidth limit
Returns <NR1>
:CHANnel<X>:COUPling
Select the different coupling states for the oscilloscope.
Syntax
:CHANnel<X>:COUPling {0|1|2}
:CHANnel<X>:COUPling?
Arguments
<X>Specify the channel number (1|2)
0Place scope in AC coupling state 1Place scope in DC coupling state 2Place scope in grounding state
Returns
<NR1>
28
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:DISPlay
Enable or disable the channel’s display.
Syntax
:CHANnel<X>:DISPlay {0|1}
:CHANnel<X>:DISPlay?
Arguments
<X>Specify the channel number (1|2)
0Disable channel <X> display 1Enable channel <X> display
Returns
<NR1>
:CHANnel<X>:INVert
Enable or disable the waveform invert function.
Syntax
:CHANnel<X>:INVert {0|1}
:CHANnel<X>:INVert?
Arguments
<X>Specify the channel number (1|2)
0Disable invert function 1Enable invert function
Returns
<NR1>
29
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:MATH
Set the math expression.
Syntax
:CHANnel<X>:MATH {0|1|2|3}
Arguments
<X>Specify the channel number (1|2)
0Select the add operator 1Select the subtract operator 2Select the FFT operation 3Turn off math function
Returns
<NR1>
:CHANnel<X>:OFFSet
Sets or query the offset voltage.
Syntax
:CHANnel<X>:OFFSet <NR3>
:CHANnel<X>:OFFSet?
Arguments
<X>Specify the channel number (1|2) <NR3> is the desired offset value in volts. The range is dependent on the scale and
the probe attenuation factor. The offset ranges are following:
Offset Range:
2mV/div ~ 50mV/div 100mV/div ~ 500mV/div
±0.5V ±5V
1V/div ~ 5V/div
±50V
30
GDS-806/810/820/840 Programming Manual
Next table shows the relationship between the <NR3> value and matching offset voltage.
0.002Æ2mV 0.01Æ10mV 0.1Æ100mV 1Æ1V
0.005Æ2mV 0.02Æ20mV 0.2Æ200mV 2Æ2V
0.05Æ50mV 0.5Æ500mV 5Æ5V
Returns
<NR3>
:CHANnel<X>:PROBe
Select the different probe attenuation factor.
Syntax
:CHANnel<X>:PROBe {0|1|2}
:CHANnel<X>:PROBe?
Arguments
<X>Specify the channel number (1|2)
01X 110X 2100X
Returns
<NR1>
31
GDS-806/810/820/840 Programming Manual
:CHANnel<X>:SCALe
Sets or query the vertical scale of the specified channel.
Syntax
:CHANnel<X>:SCALe <NR3>
:CHANnel<X>:SCALe?
Arguments
<X>Specify the channel number (1|2) <NR3> is the desired gain value in volts per division. The range is 2mV/div to 5V/div
(with 1X probe).
Next table shows the relationship between the <NR3> value and matching scale.
0.002Æ2mV 0.01Æ10mV 0.1Æ100mV 1Æ1V
0.005Æ2mV 0.02Æ20mV 0.2Æ200mV 2Æ2V
0.05Æ50mV 0.5Æ500mV 5Æ5V
Returns
<NR3>
Examples
:CHANnel1:SCALe 1, setup the channel one at 1V per division.
32
GDS-806/810/820/840 Programming Manual
:CURSor:X<X>Position
Select the cursors position of X axis.
Syntax
:CURSor:X<X>Position <NR1>
:CURSor:X<X>Position?
Arguments
<X>Specify the cursor (1|2) <NR1> is the desired position. For x-axis operation, the range is 1 to 249; for y-axis
operation, the range is 1 to 199.
Returns
<NR1>
CURSor:Y<X>Position
Select the cursors position of Y axis.
Syntax
:CURSor:Y<X>Position <NR1>
:CURSor:Y<X>Position?
Arguments
<X>Specify the cursor (1|2) <NR1> is the desired position. For x-axis operation, the range is 1 to 249; for y-axis
operation, the range is 1 to 199.
Returns
<NR1>
33
GDS-806/810/820/840 Programming Manual
:CURSor:<X>DELta? (query only)
Return the time or voltage diversity between the two vertical or horizontal cursors.
Syntax
:CURSor:XDELta?
:CURSor:YDELta?
Arguments
<X>Specify the time or voltage diversity (X|Y)
Returns
<NR3>
:CURSor:XDISplay
Enable or disable the cursors display for X axis.
Syntax
:CURSor:XDISplay {0|1}
Arguments
0Disable cursors display 1Enable cursors display
Returns
<NR1>
:CURSor:YDISplay
Enable or disable the cursors display for Y axis.
Syntax
:CURSor:YDISplay {0|1}
Arguments
0Disable cursors display
Returns
<NR1>
1Enable cursors display
34
GDS-806/810/820/840 Programming Manual
:CURSor:SOURce
Select which channel cursors is active for front panel control.
Syntax
:CURSor:SOURce {1|2|3}
:CURSor:SOURce?
Arguments
1Select channel 1 for cursors measurement 2Select channel 2 for cursors measurement 3Select math function for cursors measurement
Returns
<NR1>
:DISPlay:ACCumulate
Select the accumulate display mode.
Syntax
:DISPlay:ACCumulate {0|1}
:DISPlay:ACCumulate?
Arguments
0Disable accumulate display mode 1Enable accumulate display mode
Returns
<NR1>
35
GDS-806/810/820/840 Programming Manual
:DISPlay:CONTrast
Select contrast level of LCD screen for data readout and waveform displays.
Syntax
:DISPlay:CONTrast <NR1>
:DISPlay:CONTrast?
Arguments
<NR1> is the desired brightness level. The range is from 0~20.
Returns
<NR1>
:DISPlay:GRATicule
Select graticule display type for LCD screen.
Syntax
:DISPlay:GRATicule {0|1|2}
:DISPlay:GRATicule?
Arguments
0Select full grids 1Select cross type 2Only the frame is displayed
Returns
<NR1>
36
GDS-806/810/820/840 Programming Manual
:DISPlay:WAVeform
Select the dots (or vectors) display for data.points.
Syntax
:DISPlay:WAVeform <0|1>
:DISPlay:WAVeform?
Arguments
0Enable vectors display 1Enable dots display
Returns
<NR1>
:GONogo:CLEar (Available for firmware 2.0 and above only)
Clear the total and failure counter value on the screen. This command is equal to the function key “F5” of GO/NO-GO template edit menu.
Syntax
:GONogo:CLEar
Examples
:GON:CLE clear the GO/NO-GO counter displayed.
Note: Before running any Go/NoGo commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
37
GDS-806/810/820/840 Programming Manual
:GONogo:EXECute (Available for firmware 2.0 and above only) Start or stop the execution of GO/NO-GO comparison function. This command is
equal to the function key “F4” of GO/NO-GO menu.
Syntax
:GONogo:EXECute {0|1}
:GONogo:EXECute?
Arguments
0Stop GO/NO-GO comparison 1Start GO/NO-GO comparison
Returns
<NR1>
Note: Before running any Go/NoGo commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
:GONogo:FUNCtion (Available for firmware 2.0 and above only) This command is used to initialize or relieve the GO/NO-GO function. Before the
GO/NO-GO comparison is started. This command must be executed to enable the comparison unit.
Syntax
:GONogo:FUNCtion {0|1}
:GONogo:FUNCtion?
Arguments
0Relieve GO/NO-GO function 1Initialize GO/NO-GO function
Returns
<NR1>
38
GDS-806/810/820/840 Programming Manual
:GONogo:NGCount? (query only) (Available for firmware 2.0 and above only) Return the value of fail count and total count.
Syntax
:GONogo:NGCount?
Returns
<NR1>
:GONogo:NGDefine (Available for firmware 2.0 and above only) Sets and query the user-defined NO-GO conditions. This command is equal to the
function key “F4” pressing for UTILITY menu of second page.
Syntax
:GONogo:NGDefine {0|1}
:GONogo:NGDefine?
Arguments
0→Define waveform NOT exceed the
template means NO-GO
1→Define waveform exceed the
template means NO-GO
Returns
<NR1>
Note: Before running any Go/NoGo commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
39
GDS-806/810/820/840 Programming Manual
:GONogo:SOURce (Available for firmware 2.0 and above only) Sets and query the user-defined GO/NO-GO comparison source channel. This command is equal to the function key “F2” pressing of GO/NO-GO menu.
Syntax
:GONogo:SOURce {1|2}
:GONogo:SOURce?
Arguments
1→Select CH1 to be the comparison
source.
2→Select CH2 to be the comparison
source.
Returns
<NR1>
Note: Before running any Go/NoGo commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
:GONogo:VIOLation (Available for firmware 2.0 and above only) Sets and query the user-defined GO/NO-GO violation conditions. This command is
equal to the function key “
F3” pressing of GO/NO-GO menu.
Syntax
:GONogo:VIOLation {0|3}
:GONogo:VIOLation?
Arguments
0Stop 1Stop + beep
2Continue 3Continue + beep
Returns
<NR1>
Note: Before running any Go/NoGo commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
40
GDS-806/810/820/840 Programming Manual
:MEASure:FALL? (query only)
Return the value of timing measurement that taken for falling edge of the first pulse in the waveform.
Syntax
:MEASure:FALL?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:FREQuency? (query only)
Return the value of Frequency measurement.
Syntax
:MEASure:FREQuency?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:NWIDth? (query only)
Return the value of timing measurement of the first negative pulse in the waveform.
Syntax
:MEASure:NWIDth?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
41
GDS-806/810/820/840 Programming Manual
:MEASure:PDUTy? (query only)
Return the ratio of the positive pulse width to the signal period.
Syntax
:MEASure:PDUTy?
Returns
<NR2>. is the percentage of ratio. The range is from 1 to 99.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:PERiod? (query only)
Return the timing value of period measurement.
Syntax
:MEASure:PERiod?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
42
GDS-806/810/820/840 Programming Manual
:MEASure:PWIDth? (query only)
Return the value of timing measurement of the first positive pulse in the waveform.
Syntax
:MEASure:PWIDth?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:RISe? (query only)
Return the value of timing measurement that taken for rising edge of the first pulse in the waveform.
Syntax
:MEASure:RISe?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
43
GDS-806/810/820/840 Programming Manual
:MEASure:SOURce
Select the measured channel (channel 1 or 2). The default setting of measured channel is channel one.
Note: Please select the specific channel before implement any measurement.
Syntax
:MEASure:SOURce {1|2}
Arguments
1Enable the measurement functions for channel 1 2Enable the measurement functions for channel 2
Returns
<NR1>.
:MEASure:VAMPlitude? (query only)
Return the voltages of high value minus the low value.
Syntax
:MEASure:VAMPlitude?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
44
GDS-806/810/820/840 Programming Manual
:MEASure:VAVerage? (query only)
Return the average voltages.
Syntax
:MEASure:VAVerage?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:VHI? (query only)
Return the value of global high voltage.
Syntax
:MEASure:VHI?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:VLO? (query only)
Return the value of global low voltage.
Syntax
:MEASure:VLO?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
45
GDS-806/810/820/840 Programming Manual
:MEASure:VMAX? (query only)
Return the value of maximum amplitude.
Syntax
:MEASure:VMAX?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:VMIN? (query only)
Return the value of minimum amplitude.
Syntax
:MEASure:VMIN?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:MEASure:VPP? (query only)
Return the value of V
minus V
max
min
.
Syntax
:MEASure:VPP?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
46
GDS-806/810/820/840 Programming Manual
:MEASure:VRMS? (query only)
Return the value of true Root Mean Square voltage.
Syntax
:MEASure:VRMS?
Returns
<NR3>.
Note: Please select the specific channel before implement any measurement. See explanation for “:MEASure:SOURce”
:PRINt
Begin a hardcopy to a specified printer.
Syntax
:PRINt
:REFResh
Refresh the waveform data of LCD screen and re-display the waveform data.
Syntax
:REFResh
:RUN
Controls the RUN state of trigger system. The acquisition cycle will follow each qualified trigger in the RUN state.
Syntax
:RUN
:STOP
Controls the STOP state of trigger system. The acquisition cycle only triggered when the :RUN command is received.
Syntax
:STOP
47
GDS-806/810/820/840 Programming Manual
:TEMPlate<X>:DOWNload? (Available for firmware 2.0 and above only) Download the user-selected template.
Syntax
:TEMPlate1:DOWNload?
Arguments
<X>Specify the template number (1|100)
Returns
Format:
The string of data is following.
# Data size digit Data
size
Package
type
Template
number
Position Text
string
Reserved Check
sum
#: Begin of data string. Data size digit: Indicate the digits of following data string amount (1 digit), The
value is ‘3’ in ASCII code. Data size: The amount of current data string (3 digits). The value is “548” in ASCII
code. Package type: The GO/NO-GO template package type (1 bytes). The value is
0x03 in hex.
Template
data
48
GDS-806/810/820/840 Programming Manual
Template number: The location of template stored in memory. The valid range is from 1 to 100 dots. The content is a single byte in hex (0x01 ~ 0x64).
Position: The position of template. The valid range is from -300 to +300 dots. The content is a two bytes signed integer in hex (0xFED4 ~ 0x012C). (2 bytes, high byte first)
Text string: The user defined string that will be shown on the screen. Here we support English only. The string must include an ending character 0x00. (39 bytes).
Reserved: This location is reserved for future usage. (1 bytes). Check sum: The check sum value is coming from the sum of 500 bytes of template
data. This value is 32 bits unsigned integer in hex (4 bytes, high byte first). Template data: The effective template data which covers 250 points totally(500
bytes). Each point is two bytes signed integer in hex. The valid range is from – 100 to 100 (0x0064 ~ 0xFF9C)
Example
The following is a partial of returned data from template location 1:
Note: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
49
GDS-806/810/820/840 Programming Manual
:TEMPlate<X>:UPLoad (Available for firmware 2.0 and above only) Upload the user-defined template to the assigned location.
Syntax
:TEMPlate1:UPLoad#3548………
Format: The string of data is following.
# Data size
digit
Data size Package
type
Template number
Position Text string Reserved Check
sum
Template data
#: Begin a transmission of data string. Data size digit: Indicate the digits of following data string amount(1 digit), The
value is ‘3’ in ASCII code. Data size: The amount of current data string (3 digits). The value is “548” in ASCII
code. Package type: The GO/NO-GO template package type (1 bytes). The value is
0x03 in hex. Template number: The location of template stored in memory. The valid range is
from 1 to 100 dots. The content is a single byte in hex (0x01 ~ 0x64). Position: The position of template. The valid range is from -300 to +300 dots. The
content is a two bytes signed integer in hex (0xFED4 ~ 0x012C). (2 bytes, high byte first)
Text string: The user defined string that will be shown on the screen. Here we support English only. The string must include an ending character 0x00. (39 bytes).
Reserved: This location is reserved for future usage. (1 bytes). Check sum: The check sum value is coming from the sum of 500 bytes of template
data. This value is 32 bits unsigned integer in hex (4 bytes, high byte first).
50
GDS-806/810/820/840 Programming Manual
Template data: The effective template data which covers 250 points totally(500 bytes). Each point is two bytes signed integer in hex. The valid range is from – 100 to 100(0x0064 ~ 0xFF9C)
Arguments
<X>Specify the template number (1|100)
Example
The following is a partial of command file including the command. It’s used for transmitting template data to location 1:
Note A: In this case the position is –50 (0xFFCE) dots. The check sum is 0x000016DA
Note B: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
:TEMPlate:MAX (Available for firmware 2.0 and above only) Sets and query the number of template used for maximum boundary.
Before running this command, the oscilloscope has to be initialized as “Normal Template” mode, please add the command of “:TEMPlate:MODe 0” in order to change the settings.
Syntax
:TEMPlate:MAX {1|100}
:TEMPlate:MAX?
Returns
<NR1>
Note: A template can be defined as either MAX or MIN template only.
Note B: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
51
GDS-806/810/820/840 Programming Manual
:TEMPlate:MIN (Available for firmware 2.0 and above only) Sets and query the number of template used for minimum boundary.
Before running this command, the oscilloscope has to be initialized as “Normal Template” mode, please add the command of “:TEMPlate:MODe 0” in order to change the settings.
Syntax
:TEMPlate:MIN {1|100}
:TEMPlate:MIN?
Returns
<NR1>
Note: A template can be defined as either MAX or MIN template only.
Note B: Before running this command, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
:TEMPlate:MODe (Available for firmware 2.0 and above only) Sets and query the template mode. When we select Auto mode, the auto template
source is coming from CH1 or CH2. When we set normal mode, the template is coming from 1 of the 100 templates or RefA or RefB.
Syntax
:TEMPlate:MODe {0|1}
:TEMPlate:MODe?
Arguments
0 Select normal template. 1 Select auto template.
Returns
<NR1>
52
GDS-806/810/820/840 Programming Manual
:TEMPlate:POSition:MAX (Available for firmware 2.0 and above only) Sets and query the position of maximum template. This command will not change
the position value that stored in flash ROM. Unless you press the “Save & Create” key in GO/NO-GO edit menu. That means if you exit from the GO/NO-GO function, we will recall the value from flash ROM.
Before running this command, the oscilloscope has to be initialized as “Normal Template” mode, please add the command of “:TEMPlate:MODe 0” in order to change the settings.
Syntax
:TEMPlate:POSition:MAX <NR2>
:TEMPlate:POSition:MAX?
Arguments
<NR2> is the desired template position. The range is from -12.0 ~ +12.0 div.
Returns
<NR2>
Note A: 1 division = 25 dots
Note B: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
53
GDS-806/810/820/840 Programming Manual
:TEMPlate:POSition:MIN (Available for firmware 2.0 and above only) Sets and query the position of minimum template. This command will not change
the position value that stored in flash ROM. Unless you press the “Save & Create” key in GO/NO-GO edit menu. That means if you exit from the GO/NO-GO function, we will recall the value from flash ROM.
Before running this command, the oscilloscope has to be initialized as “Normal Template” mode, please add the command of “:TEMPlate:MODe 0” in order to change the settings.
Syntax
:TEMPlate:POSition:MIN <NR2> :TEMPlate:POSition:MIN?
Arguments
<NR2> is the desired template position. The range is from -12.0 ~ +12.0 div.
Returns
<NR2> Div
Note: 1 division = 25 dots
Note: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
54
GDS-806/810/820/840 Programming Manual
:TEMPlate:TOLerance (Available for firmware 2.0 and above only) Sets and query the tolerance of auto template.
Before running this command, the oscilloscope has to be initialized as “Auto Template” mode, please add the command of “:TEMPlate:MODe 1” in order to change the settings.
Syntax
:TEMPlate:TOLerance <NR2>
:TEMPlate:TOLerance?
Arguments
<NR2> is the desired tolerance percentage. The range is from 0.4~40 (or 0.4% to 40%).
Returns
<NR2> %
Note: Before input any template editing commands, the oscilloscope has to be initialized, please add the command of “:GONogo:FUNCtion 1” in order to initial the oscilloscope.
55
GDS-806/810/820/840 Programming Manual
TIMebase:DELay
Sets the horizontal position (delay timebase) parameter.
Syntax
:TIMebase:DELay <NR3>
:TIMebase:DELay?
Arguments
<NR3> is the desired delay time.
Returns
<NR3>
56
GDS-806/810/820/840 Programming Manual
:TIMebase:SCALe
Sets the horizontal timebase scale per division (SEC/DIV).
Syntax
:TIMebase:SCALe <NR3>
:TIMebase:SCALe?
Arguments
Sec/div
1ns
2.5ns 5ns
10ns 25ns
50ns 100ns 250ns 500ns
1μs
2.5μs
NR3
1e
2.5e 5e
10e 25e
50e 100e 250e 500e
1e
2.5e
-9
-9
-9
-9
-9
-9
-6
-6
-9
-9
-9
Sec/div
5μs 10μs 25μs 50μs
100μs 250μs 500μs
1ms
2.5ms
5ms
10ms
NR3
5e 10e 25e 50e
100e 250e 500e
1e
2.5e 5e
10e
-6
-6
-6
-6
-6
-6
-6
-3
-3
-3
-3
<NR3> is the desired timebase scale per division.
Returns
<NR3>
Sec/div
25ms
50ms 100ms 250ms 500ms
1s
2.5s 5s
10s
NR3
25e
50e 100e 250e 500e
1
2.5 5
10
-3
-3
-3
-3
-3
Examples
:TIMebase:SCALe 5e-3 sets timebase scale to 5ms per division.
57
GDS-806/810/820/840 Programming Manual
:TIMebase:SWEep
Selects the horizontal timebase sweep mode. This command is equivalent to setting the horizontal menu.
Syntax
:TIMebase:SWEep <0|1|2|3|4>
:TIMebase:SWEep?
Arguments
0Main timebase 1Window 2Window Zoom 3Roll mode 4XY mode
Returns
<NR1>
:TIMebase:WINDow:DELay
Setting and query the zoomed area (the gray color area) for window zoomed display.
Syntax
:TIMebase:WINDow:DELay <NR3>
:TIMebase:WINDow:DELay?
Arguments
<NR3> is the desired position (delay time).
Returns
<NR3>
58
GDS-806/810/820/840 Programming Manual
:TIMebase:WINDow:SCALe
Sets and query the scale (length) of the windows zoomed timebase.
Syntax
:TIMebase:WINDow:SCALe <NR3>
:TIMebase:WINDow:SCALe?
Arguments
<NR3> is the desired scale (length) of the windows zoomed timebase.
Returns
<NR3>
:TRIGger:COUPle
Select and query the type of trigger coupling.
Syntax
:TRIGger:COUPle <0|1>
:TRIGger:COUPle?
Arguments
0AC 1DC
Returns
<NR1>
59
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:TIMe
Sets and query the user-defined delay trigger time.
Syntax
:TRIGger:DELay:TIMe <NR3>
:TRIGger:DELay:TIMe?
Arguments
<NR3> is the desired user-defined delay time. The range is from 100ns~1.3ms.
Returns
<NR3>
Note: Please select the specific delay type before implement any measurement. See explanation for “:TRIGger:DELay:TYPe”
:TRIGger:DELay:EVENt
Sets and query the user-defined delay trigger events.
Syntax
:TRIGger:DELay:EVENt <NR1>
:TRIGger:DELay:EVENt?
Arguments
<NR1> is the desired user-defined delay trigger events. The range is from 2~65000.
Returns
<NR1>
Note: Please select the specific delay type before implement any measurement. See explanation for “:TRIGger:DELay:TYPe”
60
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:LEVel
Sets and query the user-defined start trigger signal level.
Syntax
:TRIGger:DELay:LEVel <NR3>
:TRIGger:DELay:LEVel?
Arguments
<NR3> is the desired user-defined start trigger signal level. The range is ±12.
Returns
<NR3>
:TRIGger:DELay:MODe
Select and query the different start trigger (i.e. external trigger) signal level.
Syntax
:TRIGger:DELay:MODe <0|1|2>
:TRIGger:DELay:MODe?
Arguments
0TTL 1ECL 2USR
Returns
<NR1>
61
GDS-806/810/820/840 Programming Manual
:TRIGger:DELay:TYPe
Select and query the different delay trigger settings.
Syntax
:TRIGger:ADVance:TYPe <0|1>
:TRIGger:ADVance:TYPe?
Arguments
0Time setting 1Event setting
Returns
<NR1>
:TRIGger:FREQuency? (query only)
Return the readout value of trigger frequency counter.
Syntax
:TRIGger:FREQuency?
Returns
<NR3>.
62
GDS-806/810/820/840 Programming Manual
:TRIGger:LEVel
Select and query the trigger level.
Syntax
:TRIGger:LEVel <NR3>
:TRIGger:LEVel?
Arguments
<NR3> is the desired trigger level voltage.
Returns
<NR3>
:TRIGger:MODe
Select and query the trigger mode.
Syntax
:TRIGger:MODe <0|1|2|3>
:TRIGger:MODe?
Arguments
0Auto Level 1Auto 2Normal 3Single
Returns
<NR1>
63
GDS-806/810/820/840 Programming Manual
:TRIGger:NREJ
Switch and query the noise rejection mode.
Syntax
:TRIGger:NREJ <0|1>
:TRIGger:NREJ?
Arguments
0OFF 1ON
Returns
<NR1>
:TRIGger:PULSe:MODe
Switch and query different pulse trigger type.
Syntax
:TRIGger:PULSe:MODe <0|1|2|3>
:TRIGger:PULSe:MODe?
Arguments
0< 1> 2=
3→≠
Returns
<NR1>
64
GDS-806/810/820/840 Programming Manual
:TRIGger:PULSe:TIMe
Select the time value for pulse width. The setting range is from 20ns to 10s.
Syntax
:TRIGger:PULSe:TIMe <NR3>
:TRIGger:PULSe:TIMe?
Arguments
<NR3> is the desired time value of pulse width, the unit is in second.
Returns
<NR3>
:TRIGger:REJect
Select and query the frequency rejection mode.
Syntax
:TRIGger:REJect <0|1|2>
:TRIGger:REJect?
Arguments
0OFF 1Low frequency reject mode 2High frequency reject mode
Returns
<NR1>
65
GDS-806/810/820/840 Programming Manual
:TRIGger:SLOP
Switch and query the rising or falling trigger slope.
Syntax
:TRIGger:SLOP <0|1>
:TRIGger:SLOP?
Arguments
0Rising slope 1Falling slope
Returns
<NR1>
:TRIGger:SOURce
Select and query the trigger source.
Syntax
:TRIGger:SOURce <0|1|2|3>
:TRIGger:SOURce?
Arguments
0Channel 1 1Channel 2 2External trigger 3AC line voltage
Returns
<NR1>
66
GDS-806/810/820/840 Programming Manual
:TRIGger:TYPe
Select and query the trigger type.
Syntax
:TRIGger:TYPe <0|1|2|3>
:TRIGger:TYPe?
Arguments
0Edge 1Video 2Pulse 3Delay
Returns
<NR1>
67
GDS-806/810/820/840 Programming Manual
:TRIGger:VIDeo:FIELd
Select and query the field on which the video trigger mode will be triggered.
Syntax
:TRIGger:VIDeo:FIELd <0|1|2>
:TRIGger:VIDeo:FIELd?
Arguments
0Line 1Odd frame (Field 1) 2Even frame (Field 2)
Returns
<NR1>
:TRIGger:VIDeo:LINe
Select and query the specified line for video signal.
Syntax
:TRIGger:VIDeo:LINe <NR1>
:TRIGger:VIDeo:LINe?
Arguments
<NR1> is the desired line. For NTSC system, the range of line is from 1~263 for Odd frame, 1-262 for even
frame. For PAL system, the range of line is from 1~313 for Odd frame, 1-312 for even
frame.
Returns
<NR1>
68
GDS-806/810/820/840 Programming Manual
:TRIGger:VIDeo:POLarity
Select and query the input video polarity.
Syntax
:TRIGger:VIDeo:POLarity <0|1>
:TRIGger:VIDeo:POLarity?
Arguments
0Positive-going sync pulses 1Negative-going sync pulses
Returns
<NR1>
:TRIGger:VIDeo:TYPe
Select and query the TV broadcast system.
Syntax
:TRIGger:VIDeo:TYPe <0|1|2>
:TRIGger:VIDeo:TYPe?
Arguments
0PAL 1NTSC 2SECAM
Returns
<NR1>
69
GDS-806/810/820/840 Programming Manual
:WMEMory<X>:DISPlay
Select whether the stored waveform will be displayed after being saved.
Syntax
:WMEMory<X>:DISPlay <NR1>
:WMEMory<X>:DISPlay?
Arguments
<X>Specify the location of RefA or RefB memory (1|2) 0OFF 1ON
Returns
<NR1>
:WMEMory<X>:ERASe
Select whether the stored waveform will be erased after being saved.
Syntax
:WMEMory<X>:ERASe
Arguments
<X>Specify the location of RefA or RefB memory (1|2)
:WMEMory<X>:LOCate
Set the position of stored waveform.
Syntax
:WMEMory<X>:LOCate <NR1>
Arguments
<X>Specify the location of RefA or RefB memory (1|2) <NR1> is the desired position. The rage is from –200 to +200.
70
GDS-806/810/820/840 Programming Manual
:WMEMory<X>:OFFSet
After the “:WMEMory<X>:LOCate” command is specified, you can adjust the position up or down by this command.
Syntax
:WMEMory<X>:OFFSet <NR1>
Arguments
<X>Specify the location of RefA or RefB memory (1|2) <NR1> is the desired offset position. The rage is from –100 to +100.
:WMEMory<X>:SAVe
Select whether the memory set will be saved.
Syntax
:WMEMory<X>:SAVe <1|2|3>
Arguments
<X>Specify the location of RefA or RefB memory (1|2) 1Channel 1 2Channel 2 3Math function
71
GDS-806/810/820/840 Programming Manual
5. Status Reports
A set of status registers allows the user to quickly determine the Digital storage oscilloscope’s internal processing status. The status register, as well as the status and event reporting system, adhere to SCPI recommendations.
Structure of System
The sketch of the status and event reporting system is showed on figure 5-1. Each component of the sketch represents a set of registers and queues which can read, report, or enable the occurrence of certain events within the system. If a specific event in the Digital storage oscilloscope that sets a bit in a status register, reading the status registers can tell you what types of events have occurred. Each bit in the status register corresponds to a bit in an enable register; the enable bit must be high for the event to be reported to the Status Byte Register. A Service Request (SRQ) is the last event to occur. The SRQ requests an interrupt on the GPIB to report events to the system controller.
Status Registers
There are two kinds of status registers are included with this oscilloscope.
z OPERation Status Registers ( CONDition, EVENt, and ENABle) z QUEStionable Status Registers (CONDition, EVENt, and ENABle)
The STATus subsystem is the hierarchical set of commands (Figure 5-2) that read the SCPI defined status registers. The lower level nodes: QUEStionable and OPERation each have three 16 bits registers: CONDition, EVENt, and ENABle. Figure 5-3 shows the sequential relationship between these three types of registers and the commands that relate to each register.
72
GDS-806/810/820/840 Programming Manual
Figure 5-1. A graphic represents the status registers and their connections.
73
GDS-806/810/820/840 Programming Manual
STATus
:QUEStionable :OPERation
:CONDition
EVENt?
:ENABle
Figure 5-2: STATus hierarchy of SCPI defined register
Condition
Register
:CONDition :ENABle
Figure 5-3: Status registers and related commands
EVENt?
Event
Register
:QUEue
[EVENt]?
To SBR
Enable
Register
The CONDition register is a read-only register which monitors the present state of the instrument. The CONDition register updates in real time and the inputs are not latched or buffered. When a condition monitored by the CONDition register becomes true, the bit for that condition also becomes true (1). When the condition is false, the bit is 0.
The read-only EVENt register latches any false-to-true change in condition. Once the bit in the EVENt register is set, it is no longer affected by changes in the corresponding bit of the CONDition register. The bit remains set until the controller reads it. The command *CLS (Clear Status) clears the EVENt registers.
74
GDS-806/810/820/840 Programming Manual
QUEStionable Status Registers.
Table 5-1 shows the bit designations of the 16 bit QUEStionable Status Register.
Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8
NU
NU
NU NU NU NU NU NU
32768 16384 8192 4096 2048 1024 512 256
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
NU NU NU NU NU NU NU NU
128 64 32 16 8 4 2 1
Table 5-1: QUEStionable Status Register
OPERation Status Registers.
Table 5-2 shows the bit designations of the 16 bit OPERation Status Register.
Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8
NU NU NU NU NU NU NU NU
32768 16384 8192 4096 2048 1024 512 256
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
NU NU NU NU NU NU NU NU
128 64 32 16 8 4 2 1
Table 5-2: OPERation Status Register
NU: not used
75
GDS-806/810/820/840 Programming Manual
Status Registers.
There are two status registers are included with this oscilloscope which defined by IEEE-488.1 and IEEE-488.2 standards.
z Status Byte Register (SBR) z Standard Event Status Register (SESR)
Status Byte Register (SBR): The SBR (Table 5-3) summaries the status of all other registers and queue.
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
OPER RQS ESB MAV QUES NU NU NU
128 64 32 16 8 4 2 1
Table 5-3: Status Byte Register (SBR) From the bit 0 to bit 2 are not used, these bits are always zero. The bit 3 (QUES, QUEStionable) is the summary bit for the QESR (QUEStionable Event Status Register). When this bit is high it indicates that status is enabled and present in the QESR. The bit 4 (MAV, Message Available) indicates that output is available in the output queue. The bit 5 (ESB, Event Status Bit) is the summary bit for the Standard Event Status Register (SESR). When this bit is high it indicates that status is enabled and present in the SESR. The bit 6 (RQS, Request Service) is obtained from a serial poll. This bit shows that this oscilloscope requests service from the GPIB controller. The bit 7 (OPER, OPERation) is the summary bit for the OESR (OPERation EVENt STATus Register).
76
GDS-806/810/820/840 Programming Manual
Use serial poll or the *STB? Query to read the contents of the SBR. The bits in the SBR are set and cleared depending on the contents of the Standard Event Status Register (SESR), the Standard Event Status Register (SESR), and the Output Queue.
Standard Event Status Register (SESR): Table 5-4 shows the SESR
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
PON USR CME EXE DDE QYE NU OPC
128 64 32 16 8 4 2 1
Table 5-4: Standard Event Status Register (SESR)
The bit 0 (OPC, Operation Complete) shows that the operation is complete. This bit is active when all pending operations are complete following an *OPC command. The bit 1 is always zero. The bit 2 (QYE, Query Error) indicates a command or query protocol error. The bit 3 (DDE, Device Error) shows that a device error occurred. The bit 4 (EXE, Execution Error) shows that an error occurred while the oscilloscope was execution a command or query. The bit 5 (CME, Command Error) shows that an error occurred while the oscilloscope was paring a command or query. The bit 6 (USR, User Request) is ignored here for this oscilloscope. The bit 7 (PON, Power On) shows that the oscilloscope was powered on.
Use the *ESR? Query to read the SESR. Reading the SESR clears the bits of the registers so that the register can accumulate information about new events.
77
GDS-806/810/820/840 Programming Manual
Enable Registers.
The enable registers determine whether certain events are reported to the Status Byte Register and SRQ. This oscilloscope has the following enable registers.
z Event Status Enable Register (ESER) z OPERation Enable Register z QUEStionable Enable Register
When one of the bits of the enable registers is high and the corresponding bit in the status register is high, the enable registers will perform a logical OR function, the output that controls the set bit of the Status Byte Register is high. Various commands set the bits in the enable registers. The following sections describe the enable registers and the commands that set them. Event Status Enable Register (ESER): The ESER controls which types of events are summarized by the Event Status Bit (ESB) in the SBR. The bits of the ESER correspond to the bits of the SESR. Use the *ESE command to set the bits in ESER. Use the *ESE? command to read it. OPERation Enable Register: Even though the OPERation Enable Register is present in this digital storage oscilloscope, the OPERation registers do not report any conditions. QUEStionable Enable Register: The QUEStionable Enable Register controls which types of events are summarized by the QUES status bit in the SBR.
78
GDS-806/810/820/840 Programming Manual
Queues
The output queue is included with this digital storage oscilloscope. Output Queue: This digital storage oscilloscope store query responses in the output queue by succeeding the IEEE 488.2 protocol. If the Digital storage oscilloscope receives a lot of un-read query data simultaneously, the output buffer of Digital storage oscilloscope will be covered repeatedly; for this moment, the output buffer will generate errors probably. The computer must read a query response before it sends the next command (or query) or it loses response to earlier queries. When an error or event occurs, the output queue stores the message. The output queue stores and reports the messages on a FIFO (first in first out) state.
79
GDS-806/810/820/840 Programming Manual
6. Program Template for GPIB
/* Filename - gds820ex1.c * * This is an example program written in C. We use a NI's GPIB interface
* card and one X86 PC to control GDS-806/810/820/840. This program could * get the waveform data from GDS-806/810/820/840, and save them to a file. * You can use Microsoft Visual C++ or Borland C++ Builder to compile this * file. And you must link this file with an object file * (BORLANDC_GPIB-32.OBJ) for Borland C++ or GPIB-32.OBJ for Visual C++ ) * that provided by National Instruments Corporation. DECL-32.H is a * Win32 C/C++ include file, that contains NI-488.2 function prototypes * and various pre-defined constants. It's also provided by NI.
*
* Copyright GOOD WILL INSTRUMENT * All Rights Reserved. */
#include <stdio.h> #include <stdlib.h> #include <string.h>
/* * Include the WINDOWS.H and DECL-32.H files. The standard Windows * header file, WINDOWS.H, contains definitions used by DECL-32.H and * DECL-32.H contains prototypes for the GPIB routines and constants. */ #include <windows.h> #include "decl-32.h"
#define ARRAYSIZE 1100 /* Size of read buffer */ #define BDINDEX 0 /* Board Index */ #define PRIMARY_ADDR_OF_DMM 7 /* Default primary address of GDS-
806/810/820/840*/ #define NO_SECONDARY_ADDR 0 /* Secondary address of device */ #define TIMEOUT T3s /* Timeout value = 5 seconds */
80
GDS-806/810/820/840 Programming Manual
#define EOTMODE 1 /* Enable the END message */ #define EOSMODE 0 /* Disable the EOS mode */ void Acquire(void); void Delay(int); void ShowIbsta(char);
int Dev; /* Device handle */ unsigned char ReadBuffer[201]; /* Read data buffer */ char ErrorMnemonic[21][5] = {"EDVR", "ECIC", "ENOL", "EADR", "EARG", "ESAC", "EABO", "ENEB", "EDMA", "", "EOIP", "ECAP", "EFSO", "", "EBUS", "ESTB", "ESRQ", "", "", "", "ETAB"}; unsigned char WaveBuf[ARRAYSIZE];
int _cdecl main(void) { int i, count=0; unsigned char ch; Dev = ibdev (BDINDEX, PRIMARY_ADDR_OF_DMM, NO_SECONDARY_ADDR, TIMEOUT, EOTMODE, EOSMODE); if(ibsta & ERR) printf("\n\rUnable to open device"); ibclr (Dev); if(ibsta & ERR) printf("\n\rUnable to clear device(ibsta= %x), (iberr=%x)",ibsta,iberr);
ibwrt (Dev, "*CLS\n", 5L); /*Clear ths status registers and*/ printf("\n\r*CLS\n\r"); /*Output buffer of GDS-806/810/820/840./ if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
81
GDS-806/810/820/840 Programming Manual
Delay(1000); ibwrt (Dev, "*IDN?\n", 6L); /*Get the unique identification */ printf("*IDN?\n\r"); /*code of the GDS-806/810/820/840.*/ if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; } while(1){ ibrd (Dev, ReadBuffer, 100); /*Read datas from input bufer. */ if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(0); return 0; } for(i=0;i<ibcntl;i++){ ch=ReadBuffer[i]; WaveBuf[count++]=ch; } if(ch=='\n'){ WaveBuf[count]=0x00; printf("%s\n\r",WaveBuf); break; } }
Delay(1000); ibwrt (Dev, ":RUN\n", 5L); /*Let the GDS-806/810/820/840 run. */ printf(":RUN\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
82
GDS-806/810/820/840 Programming Manual
Delay(1000); ibwrt (Dev, ":CHANnel1:DISPlay 1\n", 20L);/*Set channel 1 display on */ printf(":CHANnel1:DISPlay 1\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(1000); ibwrt (Dev, ":TIMebase:SCALe 2.5e-4\n", 23L);/*Set timebase: 200us/div*/ printf(":TIMebase:SCALe 2.5e-4\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(1000); ibwrt (Dev, ":CHANnel1:OFFSet 0\n", 19L); /*Set offset voltage: 0V */ printf(":CHANnel1:OFFSet 0\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(1000); ibwrt (Dev, ":CHANnel1:SCALe 0.5\n", 20L); /*Set vertical scale:
500mV/div */ printf(":CHANnel1:SCALe 0.5\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
83
GDS-806/810/820/840 Programming Manual
Delay(1000); ibwrt (Dev, ":ACQuire:MODe 0\n", 16L); /*Set acquire mode:
sample mode */ printf(":ACQuire:MODe 0\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(1000); ibwrt (Dev, ":TRIGger:LEVel 0.3\n", 19L); /*Set trigger level: 0.3V*/ printf(":TRIGger:LEVel 0.3\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(1000); ibwrt (Dev, ":TRIGger:MODe 1\n", 16L); /*Set trigger mode: AUTO */ printf(":TRIGger:MODe 1\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; }
Delay(10000); /*Waiting for acquisition process and GDS-820/GDS-840
internal*/ /*process. The delay time depend on the timebase that*/ /*you selected. Low speed division require much more */ /*time for acquisition. It's recommended a minimum */ /*200ms delay time after the last command, before */ /*getting the waveform data from GDS-806/810/820/840. */
Acquire(); /*Get waveform data. */
84
GDS-806/810/820/840 Programming Manual
ibwrt (Dev, ":SYSTEM:UNLOCK\n",15L); /*Unlock GDS-806/810/820/840
from remote control.*/ printf(":SYSTEM:UNLOCK\n\r"); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); return 0; } ibonl(Dev,0); /*Take the device offline. */ return 1; }
void Acquire(void) { short i, j; FILE *writeP; char writeFilename[15] = "wavedata.txt"; short wave; int tmp, count=0; ibwrt (Dev, ":ACQUIRE1:POINT\n", 16L); printf(":ACQUIRE1:POINT\n\r");
Delay(1000); if((ibsta&ERR)||(ibsta&TIMO)){ ibclr (Dev); ibwrt (Dev, "*CLS\n", 5L); ShowIbsta(1); Delay(100000); ibwrt (Dev, ":ACQUIRE1:POINT\n", 16L); /*Try again! */ printf(":ACQUIRE1:POINT\n\r");
if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(1); Delay(100000); exit (1); } }
85
GDS-806/810/820/840 Programming Manual
while(1){ ibrd(Dev, ReadBuffer, 100); if((ibsta&ERR)||(ibsta&TIMO)){ ShowIbsta(0); Delay(100000); exit (1); } for(i=0;i<ibcntl;i++) WaveBuf[count++]=ReadBuffer[i]; printf("\rReceived: %7d ", count); if(count>=1014){ printf("\rReceived: %7d bytes.\n\r", count); break; } }
/*Open file "wavedata.txt" and write waveform datas to it.*/ writeP=fopen(writeFilename, "w"); if(writeP == NULL){
printf("error: cannot write '%s'\n", writeFilename);
exit(1); } j=14; for(i=0;i<500;i++){ wave=WaveBuf[j++]<<8; wave+=WaveBuf[j++]; fprintf(writeP, "%d\n", wave); } tmp = fclose(writeP); if(tmp == EOF){ printf("error: cannot write '%s'\n\r", writeFilename); exit(1); } }
86
GDS-806/810/820/840 Programming Manual
void Delay(int i) { int j,k; for(j=0;j<i;j++){ for(k=0;k<30000;k++) ; } }
void ShowIbsta(char c) { if(ibsta & ERR){ if(c) printf("\n\rUnable write to device(ibsta= %x), (iberr=%x)\n\r",ibsta,iberr); else printf("\n\rUnable read from device(ibsta= %x), (iberr=%x)\n\r",ibsta,iberr); } else{ if(c) printf("\n\rWrite, ibsta= %x",ibsta); else printf("\n\rRead, ibsta= %x",ibsta); } }
87
GDS-806/810/820/840 Programming Manual
Appendix A: How can we convert the hexadecimal format to a floating point format
Question: As the previous example listed on page 27, how can the hexadecimal value of “0×4C 0×BE 0×BC 0×20” transfer to 100M(Sa/s)?
Answer:
just use the attached C language program:
#include <stdio.h> int main() { union data { char a[4]; float f; } myData; myData.a[0]=0x20; /* little-endian byte ordering here, */ myData.a[1]=0xbc; /* so, the last of 0x20 should be placed */ myData.a[2]=0xbe; /* in the first order. */ myData.a[3]=0x4c; printf("Here is the Data:\n%0x\n%0x\n%0x\n%0x\n%.3e\n",\ myData.a[0]&0xff,
myData.a[1]&0xff, myData.a[2]&0xff,
myData.a[3]&0xff,\ myData.f ); return 0; }
and the output result is following:
88
Loading...