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
Loading...
+ 62 hidden pages