that in all previously published material. Specifications and price change privileges reserved.
T ektronix, Inc., P.O. Box 500, Beaverton, OR 97077
TEKTRONIX and TEK are registered trademarks of T ektronix, Inc.
This is the Programmer Manual for the DG2020A Data Generator and Pods.
This manual provides information on operating these instruments using General
Purpose Interface Bus (GPIB) interface and RS-232-C interface.
This manual provides the following information:
HGetting Started describes how to connect and set up for remote operation.
HSyntax and Commands defines the command syntax and processing
conventions and describes each command in the data generator command
set.
HStatus and Events explains the status information and event messages
reported by the data generator.
HAppendices contains various topics of use to the programmer.
HGlossary and Index contains a glossary of common terms and an index to
this manual.
Related Manuals
Other documentation for the data generator includes:
HThe User Manual that describes the operation of the Data Generator that was
supplied as a standard accessory with the instrument.
HThe Service Manual (optional accessory) provides information for maintain-
ing and servicing the Data Generator.
DG2020A Programmer Manual
v
Preface
vi
DG2020A Programmer Manual
Getting Started
Overview
The Data Generator has two interfaces for remote operation — the GPIB interface
and the RS-232-C interface. All menu controlled and front-panel controlled
functions, except the ON/STBY function, the edit function, and the GPIB and
RS-232-C parameter setup functions, can be controlled through the GPIB or the
RS-232-C interface using the programming command set (see Section 2).
The GPIB interface conforms to ANSI/IEEE Std 488.1-1987, which specifies the
hardware interface, its basic functional protocol, and a set of interface messages
(codes) that control the interface functions. This instrument also conforms to
ANSI/IEEE Std 488.2-1987 which specifies Codes, Formats, Protocols, and
Common Commands to support the system application. The functional layers of
the GPIB system are shown in Figure 1-1.
BUS
DeviceĆspecific Messages
Common Commands and Queries
Syntax and Data Structures
Remote INTFC Messages
D
CBAABCD
System Component xSystem Component y
Specified
by
Device
IEEE 488.2
Standard
A: Interface Function Layer
B: Message Communication Function Layer
C: Common System Function Layer
D: Device Function Layer
IEEE 488.1
Standard
Figure 1Ć1: Functional layers in gpib system
IEEE 488.2
Standard
Specified
by
Device
DG2020A Programmer Manual
1Ć1
Getting Started
Choosing an Interface
The RS-232-C interface, which was established by the Electronic Industries
Association (EIA), provides a common basis of communication between devices
that exchange data. This interface has long been used on terminals, modems,
printers, and other devices. The RS-232-C interface that the data generator
provides also uses most of the same Codes, Formats, Protocols, and Common
Commands as are used with the GPIB interface (ANSI/IEEE Std 488.2-1987).
Your system hardware may let you choose which interface to use with your
system; if so, you should consider the comparative advantages and disadvantages
of each interface. For example, the GPIB interface is an eight-bit parallel bus and
therefore it offers high-speed data transfers and multiple instrument control. In
contrast, the RS-232-C interface is a slower serial data bus for single instrument
control, but it is easy to connect to and can be used with a low-cost controller.
Table 1-1 compares the GPIB and RS-232-C interface.
Table 1Ć1: GPIB and RSĆ232ĆC comparison
Operating attributeGPIBRSĆ232ĆC
CableANSI/IEEE Std 4889Ćwire (DCE)
Data flow controlHardware, 3Ćwire handshakeFlagging: soft (XON/XOFF),
hard (DTR/CTS)
Data format8Ćbit parallel8Ćbit serial
Interface controlOperator lowĆlevel control
message
Interface messagesMost ANSI/IEEE Std 488Device clear via ASCII break
Interrupts reportedService requests
status and event code
Message termination
(Receive)
Message termination
(Transmit)
TimingAsynchronousAsynchronous
Transmission path length≤2 meters between devices;
Speed200 Kbytes/sec19,200 bits/sec
Hardware EOI, software LF, or
both
Hardware EOI, and softwareLFSoftware LF
≤20 meters total cabling for
GPIB system
None
signal
Status and event code
(no service requests)
Software CR, LF, or CR and
LF
≤15 meters
1Ć2
System environmentMultiple devices (≤15)Single terminal (point to point
connection)
DG2020A Programmer Manual
Installing for GPIB Communication
With the power off, connect a GPIB cable from the GPIB controller to the
ANSI/IEEE Std 488 port (GPIB) connector on the rear panel of the data
generator (see Figure 1-2). For example, when using an MS-DOS compatible
controller, connect the GPIB cable between the National Instrument PC2A GPIB
board and the data generator GPIB connector.
GPIB Connector
Getting Started
POD C
POD B
POD A
IEEE STD 488 PORT
RS-232-C
CALIBRATION
CLOCK IN
CLOCK OUT
Figure 1Ć2: GPIB connector
Instruments can be connected to the GPIB in linear or star configurations or in a
combination of both configurations. A linear hookup is one where a GPIB cable
is used to string one device to a second, and then another GPIB cable is used to
string from a second to a third, and so on until all devices in the system are
connected. A star setup is one where one end of all the GPIB cables in the
system are attached to one device. Refer to Figure 1-3 for these GPIB system
configurations.
DG2020A Programmer Manual
1Ć3
Getting Started
C
Star Configuration
BD
A
Restrictions
F
A
D
BCDEF
E
A
C
E
Linear Configuration
Combination of Star and
Linear Configurations
F
GH
B
Figure 1Ć3: GPIB system configurations
Consider the following rules when distributing instruments on the GPIB:
1Ć4
1. No more than 15 total devices (including the controller) can be included on a
signal bus.
2. In order to maintain the electrical characteristics of the bus, one device load
must be connected for every two meters of cable (most often, each device
represents one device load to the bus).
3. The total cable length (cumulative) must not exceed 20 meters.
4. At least two-thirds of the device loads must be powered on.
DG2020A Programmer Manual
Getting Started
Setting the GPIB
Parameters
To set the GPIB parameters, proceed as follows:
1. Press the UTILITY button in the MENU column to the right of the screen.
The UTILITY menu appears above the bottom menu buttons.
2. Press the System bottom menu button to display the System menu (See
figure 1-4).
3. Select the Configure item from the GPIB menu using the up and down arrow
buttons. Set the GPIB operating mode using the left and right arrow buttons.
HTalk/Listen. Sets the communications mode to talk/listen.
HTalk Only. Sets the communications mode to talk only, which is used for
hardcopy output.
HOff Bus. Logically disconnect the data generator from GPIB system.
NOTE. The data generator accepts as a terminator either the software LF (Line
Feed), sent as the last data byte, or the hardware EOI, with the EOI line asserted
concurrently with the last data byte sent.
4. Select the Address item from the GPIB menu using the up and down arrow
buttons. Then use the rotary knob to set the primary address to a value in the
range 0 to 30.
GPIB Menu
5. Select the Remote Port item using the up and down arrow buttons, and
additionally, highlight ”GPIB” using the left and right arrow buttons. This
selects the GPIB as the remote interface.
Figure 1Ć4: GPIB parameter settings
DG2020A Programmer Manual
1Ć5
Getting Started
Installing for RSĆ232ĆC Communication
Connect an RS-232-C cable from the computer terminal to the RS-232-C
connector on the rear panel of the data generator. Use a configuration based on
the settings for the data flow control (flagging).
The RS-232-C provides a point-to-point connected communication interface
between devices (see Figure 1-5). The data generator can transmit and receive the
same message serially over the RS-232-C interface as it can in parallel over the
GPIB interface.
Controller
Figure 1Ć5: RSĆ232ĆC pointĆtoĆpoint connection
Several connectors are used with the RS-232-C interface: a DTE device uses a
standard 25-pin male D-type shell connector; a DCE device uses a standard
25-pin female D-type shell connector. Some recent computers implement the
RS-232-C interface using 9-pin D-type connector.
This data generator uses a standard 9-pin D-type shell connector, provided on the
rear panel (see Figure 1-6), along with a 9-pin male to 25-pin male conversion
cable. Figure 1-7 on page 1-8 shows both 9-pin and 25 pin connectors with
their pin number assignments.
DG2020A
1Ć6
DG2020A Programmer Manual
IEEE STD 488 PORT
Getting Started
POD C
POD B
POD A
RS-232-C
CLOCK IN
CLOCK OUT
RSĆ232ĆC
Connector
CALIBRATION
Figure 1Ć6: RSĆ232ĆC port
This data generator is designed as DCE device. You may connect it up to
15 meters (50 feet) from a DTE device using a straight-through male-to-female
cable. However, if the other device is instead configured as a DCE device, you
will need a special adapter or null-modem cable for local DCE-to-DCE
communications. Refer to the wiring examples in the Figure 1-8 for the proper
signal connections between devices.
NOTE.
available.
In this data generator, only TxD, RxD, DTR, CTS pins and Signal Ground are
DG2020A Programmer Manual
1Ć7
Getting Started
Pin
9ĆPIN DĆSHELL
1
2
6
7
8
9
NOTE: TxD, RxD, DTR, CTS and Ground lines are only available
in the data generator.
Receive Data (RxD)3
2
3 Transmit Data (TxD)2
3
4 Data Terminal Ready (DTR) 20
4
5 Signal Ground7
5
8 Clear to Send (CTS)5
25ĆPIN DĆSHELL
14
15
16
17
18
19
20
21
22
23
24
25
1
2
3
4
5
6
7
8
9
10
11
12
13
Figure 1Ć7: Pin assignments of 9Ćpin and 25Ćpin DĆtype shell connector
PinPinPin
2
3
4
5
8
9Ćpin DCE to 9Ćpin DTE9Ćpin DCE to 9Ćpin DCE
2
3
4
5
8
2
3
4
5
8
2
3
4
5
8
PinPin
2
3
4
5
8
9Ćpin DCE to 25Ćpin DTE
NOTE: When using software flow control, the CTSĆDTR lines do not need to be connected.
To set the RS-232-C parameters, perform the following steps:
1. Press the UTILITY button in the MENU column to the right of the screen.
The UTILITY menu appears above the bottom menu buttons.
2. Press the System bottom menu button to display the System menu (See
figure 1-9).
3. Select the Baudrate item from the Serial menu using the up and down arrow
buttons. Here select the data transfer rate using the left and right arrow
buttons. The rate can be set to 300, 600, 1200, 2400, 4800, 9600, or 19200
baud.
4. Select the Data Bits item from the Serial menu using the up and down arrow
buttons. Then use the left and right arrow buttons to select the data bit length
for each character. The bit length can be set to either 7 or 8 bits.
5. Select the Parity item from the Serial menu using the up and down arrow
buttons. Then use the left and right arrow buttons to set the error check bit
for each character. The error bit can be set to None, Even, or Odd parity.
6. Select the Stop Bits item from the Serial menu using the up and down arrow
buttons. Then use the left and right arrow buttons to select the number of
stop bits sent after each character. The number of stop bits can be set to
either 1 or 2.
Serial Menu
7. Select the Handshake item from the Serial menu using the up and down
arrow buttons. Then use the left and right arrow buttons to select the method
of controlling the flow of data between devices. The data flow method can
be set to Hard (DTR/CTS), Soft (XON/XOFF), and Off (no flow control).
8. Select the Remote Port item using the up and down arrow buttons, and
additionally, highlight ”RS232C” using the left and right arrow buttons. This
selects the RS-232-C interface as the remote interface.
Figure 1Ć9: RSĆ232ĆC parameter settings
DG2020A Programmer Manual
1Ć9
Getting Started
1Ć10
DG2020A Programmer Manual
Command Syntax
A large set of commands can be used to control the operations and functions of
the data generator from an external controller. This section describes the syntax
and communication rules for using these commands to operate the data
generator.
Command Notation
The command syntax is in extended BNF (Backus-Naur Form) notation. The
extended BNF symbols used in the command set are shown in the following
table.
Table 2Ć1: BNF symbols and meanings
SymbolMeaning
<ą>Indicates a defined element
|Delimits Exclusive OR elements
{ą}Delimits a group of elements one of which the programmer must select
[ą]Delimits an optional element that the programmer may omit
[ą]...Delimits an optional element that the programmer may omit or may repeat one
::=Indicates that the left member is defined as shown by the the right member
Program and Response Messages
Programs created or placed in an external controller are transferred to the data
generator as a program message. A program message is a sequence of zero or
more program message units delimited by the program message unit delimiter,
the semicolon (;).
A program message unit is a set command or query command. The data
generator performs a function or changes a setting or mode when it receives a set
command; when it receives a query command, it returns measurement data,
settings, status codes and/or status messages. The data generator transfers these
response messages to the external controller.
or more times
DG2020A Programmer Manual
2Ć1
Command Syntax
Command and Query Structure
Commands are either set commands or query commands (usually just called
commands and queries in this manual). Most commands have both a set form
and query form. The query form of a command is the same as the set form,
except that the query form ends with a question mark.
Figure 2-1 shows a flowchart of the structure of the commands and queries. The
structure of the header is described in detail in Header on page 2-6.
Command
,
Character Encoding
Header
Mnemonic
Argument
,
?
:
:
Header
Mnemonic
Argument
?
,
Argument
,
Argument
Command
Query
Query
Query
Command
Command
Figure 2Ć1: Command and query structure flowchart
The program can be described using the American Standard Code for Information Interchange (ASCII) character encoding.
2Ć2
This seven-bit ASCII code is used for the majority of syntactic elements and
semantic definitions. In special cases, an eight-bit ASCII Code is allowed in the
arbitrary block arguments described on page 2-5. The ASCII code character set
table is found in Appendix A.
DG2020A Programmer Manual
Syntactic Delimiters
Command Syntax
Syntactic elements in a program message unit are delimited (differentiated) with
colons, white space, commas, or semicolons.
Colon (:). Typically delimits the compound command header.
MMEMORY:DELETE:ALL, SOURCE:OSCILLATOR:SOURCE
White Space. Typically delimits command/query headers from the argument.
DIAGNOSTIC:SELECT ALL
SYSTEM:DATE 1995,3,4
DIAGNOSTIC:SELECT and SYSTEM:DATE are the command headers, and ALL and
1995,3,4 are the arguments.
Comma (,). Typically delimits between multiple arguments. In the above
example, a comma delimits the multiple arguments 1995, 3 and 4.
White Space
Special Characters
Semicolon (;). Typically delimits between multiple commands (or multiple
program message units). For more information about using the semicolon, refer
to Concatenating Commands on page 2-8.
White space, which is used to delimit certain syntactic elements in a command,
is defined in the data generator as a single ASCII-encoded byte in the range
ASCII 0-32 (decimal). This range consists of the standard ASCII characters
exclusively except for ASCII 10, which is the Line Feed (LF) or New Line (NL)
character.
The Line Feed (LF) character or the New Line (NL) character (ASCII 10) and all
characters in the range of ASCII 127-255 are defined as special characters. These
characters are used in arbitrary block arguments only; using these characters in
other parts of any command yields unpredictable results.
DG2020A Programmer Manual
2Ć3
Command Syntax
Arguments
In a command or query, one or more arguments follow the command header. The
argument, sometimes called program data, is a quantity, quality, restriction, or
limit associated with the command or query header. Depending on the command
or query header given, the argument is one of the following types:
HDecimal Numeric
HString
HArbitrary Block
Decimal Numeric
The data generator defines a decimal numeric argument as one expressed in one
of three numeric representations — NR1, NR2, or NR3. This definition complies
with that found in ANSI/IEEE Std 488.2-1987. Any commands that use
arguments in any of the the first three notations can use a fourth notation NRf
(for Numerical Representation flexible). The four formats are shown in Table
2-2.
As just implied, you can use NRf notation for arguments in your programs for
any commands that this manual lists as using any of NR1, NR2, or NR3 notation
in its arguments. Be aware, however, that query response will still be in the
format specified in the command. For example, if the command description is
:DESE <NR1>, you can substitute NR2 or NR3 when using the command in a
program. However, if you use the query :DESE?, the data generator will respond
in the format <NR1> to match the command description in this manual.
2Ć4
Unit and SI Prefix
If the decimal numeric argument refers to a voltage or frequency, you can
express it using SI units instead of in the scaled explicit point input value format
<NR3>. (SI units are units that conform to the Systeme International d’Unites
standard.) For example, you can use the input format 200mV or 1.0MHz instead
of 200.0E–3 or 1.0E+6, respectively, to specify voltage or frequency.
DG2020A Programmer Manual
Command Syntax
You can omit the unit, but you must include the SI unit prefix. You can use either
upper or lowercase units.
V or v for voltage
Hz, HZ, or hz for frequency
The SI prefixes, which must be included, are shown below. Note that either
lower or upper case prefixes can be used.
String
SI prefix
Corresponding Power10
1
1
Note that the prefix m/M indicates 10-3when the decimal numeric argument denotes
voltage, but 10
6
when it denotes frequency.
m/Mk/Km/M
-3
10
3
10
6
String, sometimes referred to as a string literal, a literal, or just a string, is
defined as a series of characters enclosed by double quotation marks (”) as in:
"This is a string constant"ąąorąą"0 .. 127"
To include a double quoted character in the string, insert an additional double
quote character ahead of the double quote character in the string. For example,
the string:
serial number "B010000"
would be defined as:
"serial number ""B010000"""
Single quotation marks (’) can also be used instead of double quotation marks.
For instance:
Arbitrary Block
DG2020A Programmer Manual
'serial number ''B010000'''
String constants may be of any length up to the memory limits of the instrument
in which the message is parsed.
An arbitrary block argument is defined as:
#<byte count digit><byte count>[<contiguous eightĆbit data
byte>]...
or:
#<contiguous eightĆbit data byte]... <terminator>
2Ć5
Command Syntax
Header
where:
<byte count digit>::= a nonzero digit in the range ASCII 1–9 that defines the
number of digits (bytes) in the <byte count> field.
<byte count>::= any number of digits in the range ASCII 0–9 that define how
many bytes are in the <contiguous 8Ćbit data byte> field.
<contiguous 8Ćbit data byte>::= a <byte count> number of 8-bit bytes in
the range ASCII 0–255 that define the message. Each byte defines one character.
<terminator>::= a software LF followed by a hardware EOI. For example,
#16AB4ZLT<LF><&EOI>
Header Mnemonic
Pod and Channel
Representation
Header Structure
The header mnemonic represents a header node or a header subfunction. The
command or query header comprises one or more header mnemonics that are
delimited with the colon (:).
The pod and channel can be specified by using the OUTPut:POD<s>:CH<n>
header mnemonic in commands and query commands. The term <s> is either A,
B, or C, and expresses the connected pattern data output connector for the pod
being specified. The term <n> is a number between 0 and 11 that expresses the
specified channel.
Commands and queries can be structured into six basic forms.
Compound Command Header. A command that contains multiple header
mnemonics plus argument(s). Its message format is:
[:]<Header Mnemonic>[:<Header Mnemonic>]...
[<Argument>[,<Argument>]...]
such as:
MMEMORY:INITIALIZE HD1
or
SYSTEM:SECURITY:STATE ON
Compound Query Header. A command that contains multiple header mnemonics
followed by a question mark (?). Its message format is:
[:]<Header Mnemonic>[:<Header Mnemonic>]...?
[<Argument>[,<Argument>]...]
such as:
DIAGNOSTIC:RESULT?
or
DATA:BLOCK:SIZE? "BLOCK1"
DG2020A Programmer Manual
2Ć7
Command Syntax
Common Command Header. A command that precedes its header mnemonic with
an asterisk (*). Its message format is:
<Header Mnemonic> [<Argument>[,<Argument>]...]
such as:
*RST
The common commands are defined by IEEE Std 488.2 and are common to all
devices which support IEEE Std 488.2 on the GPIB bus.
Common Query Header. A command that precedes its header mnemonic with an
asterisk (*) and follows it with a question mark (?). Its message format is:
<Header Mnemonic>? [<Argument>[,<Argument>]...]
such as:
*IDN?
The common commands are defined by IEEE Std 488.2 and are common to all
devices which support the IEEE Std 488.2 on the GPIB bus.
Concatenating Commands
Most of the compound command headers are in a tree structure. The tree
structure of an example command is diagrammed below. Note that the top of the
structure always begins with a colon (:).
You must include the complete path in each header when there is no common
complete path to the start of the tree structure (the colon). However, note that
part of each header in the above example has a common path :DATA:BLOCK. You
DG2020A Programmer Manual
Command Syntax
may shorten compound command structures with such headers. For example, the
command above may be rewritten as follows.
Note that the mnemonics :DATA and :BLOCK are assumed from the first header
by the headers that follow. The following command descriptions are valid
examples of commands shortened using the principle just described. (Note that
the insertion of common command (*SRE) between headers does not prevent the
headers that follow from assuming the earlier header mnemonics.)
The query causes the data generator to return information about its status or
settings. A few queries also initiate an operation action before returning
information; for instance, the *TST? query performs the self test.
If the programmer has enabled headers to be returned with query responses, the
data generator formats a query response like the equivalent set-command header
followed by its argument(s). When headers are turned off for query responses,
only the values are returned. Table 2-3 shows the difference in query responses.
Use the command HEADER ON when you want the header returned along with the
information. You can save such a response and send it back as a set-command
later. Use HEADER OFF when you want only the information back.
Other General Command Conventions
Upper and Lower Case
Abbreviation
The instrument accepts upper, lower, or mixed case alphabetic messages. The
following three commands are recognized as identical.
HEADER ON
or
header on
or
header On
Any header, argument, or reserved word that is sent to the data generator can be
abbreviated. The minimum required spelling is shown in upper case throughout
the subsection Command Groups beginning on page 2-11. The command
TRIGger:SLOPe POSitive can be rewritten in either of the following forms.
TRIGGER:SLOPE POSITIVE
or
TRIG:SLOP POS
2Ć10
DG2020A Programmer Manual
Command Groups
This subsection describes the organization of the DG2020A Data Generator
command as a number of functional groups. (See subsection CommandDescriptions on page 2-19 for a complete description of each command in
alphabetical order.)
Throughout this section, the parenthesized question symbol (?) follows the
command header to indicate that both a command and query form of the
command can be used.
Command Summaries
Tables 2-4 through 2-14 describe each command in each of the 11 functional
groups.
DATA Commands
The DATA commands are used to define blocks, groups, and sequences, to set up
pattern data, and to set which sequence controls become valid when the run
mode is set to Enhanced.
Table 2Ć4: DATA commands
HeaderDescription
DATA?Query the settings related to pattern data
DATA:BLOCk:ADDAdd a block definition
DATA:BLOCk:DEFine(?)Set the block definitions
DATA:BLOCk:DELeteDelete a block definition
DATA:BLOCk:DELete:ALLDelete all block definitions
DATA:BLOCk:RENameChange a block name
DATA:BLOCk:SIZe(?)Change the size of a block
DATA:GROUp:ADDAdd a group definition
DATA:GROUp:BIT(?)Change a groups bit structure
DATA:GROUp:DEFine(?)Sets the group definitions
DATA:GROUp:DELeteDelete a group definition
DATA:GROUp:DELete:ALLDelete all group definitions
DG2020A Programmer Manual
DATA:GROUp:NAME?Query the name of a group
DATA:GROUp:RENameChange a group name
DATA:MSIZe(?)Set the pattern data memory size
2Ć11
Command Groups
Table 2Ć4: DATA commands (Cont.)
HeaderDescription
DATA:PATTern:BIT(?)Set individual pattern data bits
DATA:PATTern[:WORD](?)Set pattern data in word units
DATA:SEQuence:ADDAdd a sequence step
DATA:SEQuence:DEFine(?)Set the sequence definitions
DATA:SEQuence:DELeteDelete a sequence step
DATA:SEQuence:DELete:ALLDelete all sequence definitions
DATA:SEQuence:EVJ(?)Set the event jump on/off state
DATA:SEQuence:EVJTO(?)Set the event jump destination
DATA:SEQuence:LOOP(?)Set the infinite loop on/off state
DATA:SEQuence:REPeat(?)Set the repeat count
DATA:SEQuence:TWAIT(?)Set the trigger wait on/off state