Inspect? Command
Waveform? Command
Waveform Command
More Control of Waveform Queries
High-speed Waveform Transfer
Status Registers
Overview of Status and Service Request Reporting
Status Byte Register (STB)
Standard Event Status Register (ESR)
Standard Event Status Enable Register (ESE)
Service Request Enable Register (SRE)
Parallel Poll Enable Register (PRE)
Internal State Change Status Register (INR)
Internal State Change Enable Register (INE)
Command Error Status Register (CMR)
Device Dependent Error Status Register (DDR)
Execution Error Status Register (EXR)
User Request Status Register (URR)
35
35
37
37
179
179
180
182
187
188
188
191
193
194
195
195
195
195
196
196
196
196
196
|
|
|
Appendix A
Table of Contents
Example 1: Use of the Interactive
GPIB Program ’IBIC’
Example 2: GPIB Program for IBM PC
(High-level Function Calls)
Example 3: GPIB Program for IBM PC
(Low-level Function Calls)
Appendix B
The Waveform Template
199
200
202
205
1
GENERAL INFORMATION
INITIAL INSPECTION
WARRANTY
It is recommended that the shipment be thoroughly inspected immediately upon delivery to the purchaser. All material in the
container should be checked against the enclosed Packing List.
LeCroy cannot accept responsibility for shortages in comparison
with the Packing List unless notified promptly. If the shipment is
damaged in any way, please contact the Customer Service Depart-
ment or local field office immediately.
LeCroy warrants its oscilloscope products to operate within specifications under normal use for a period of two years from the date of
shipment. Spares, replacement parts and repairs are warranted for
90 days. The instrument’s firmware is thoroughly tested and
thought to be functional, but is supplied "as is" with no warranty of
any kind covering detailed performance. Products not manufac-
tured by LeCroy are covered solely by the warranty of the original
equipment manufacturer.
In exercising this warranty, LeCroy will repair or, at its option,
replace any product returned to the Customer Service Department
or an authorized service facility within the warranty period, provided that the warrantor’s examination discloses that the product
is defective due to workmanship or materials and that the defect
has not been caused by misuse, neglect, accident or abnormal conditions or operation.
The purchaser is responsible for transportation and insurance
charges for the return of products to the servicing facility. LeCroy
will return all in-warranty products with transportation prepaid.
This warranty is in lieu of all other warranties, expressed or implied, including but not limited to any implied warranty of
merchantability, fitness, or adequacy for any particular purpose or
use. LeCroy shall not be liable for any special, incidental, or con-
sequential damages, whether in contract or otherwise.
PRODUCT ASSISTANCE
MAINTENANCE
AGREEMENTS
Answers to questions concerning installation, calibration, and use
of LeCroy equipment are available from the Customer Service
Department, 700 Chestnut Ridge Road, Chestnut Ridge, New
York 10977-6499, U.S.A., tel. (914)578-6061, and 2, rue
(41)22/719 21 11, or your local field engineering office.
LeCroy offers a selection of customer support services. Maintenance agreements provide extended warranty and allow the
customer to budget maintenance costs after the initial two year
warranty has expired. Other services such as installation, training,
enhancements and on-site repair are available through specific
Supplemental Support Agreements.
General Information
DOCUMENTATION
DISCREPANCIES
SERVICE PROCEDURE
RETURN PROCEDURE
LeCroy is committed to providing state-of-the-art instrumenta-
tion and is continually refining and improving the performance of
its products. While physical modifications can be implemented
quite rapidly, the corrected documentation frequently requires
more time to produce. Consequently, this manual may not agree in
every detail with the accompanying product. There may be small
discrepancies in the values of components for the purposes of
pulse shape, timing, offset, etc., and, occasionally, minor logic
changes. Where any such inconsistencies exist, please be assured
that the unit is correct and incorporates the most up-to-date cir-
cuitry. In a similar way the firmware may undergo revision when
the instrument is serviced. Should this be the case, manual up-
dates will be made available as necessary.
Products requiring maintenance should be returned to the Cus-
tomer Service Department or authorized service facility. LeCroy
will repair or replace any product under warranty at no charge.
The purchaser is only responsible for transportation charges.
For all LeCroy products in need of repair after the warranty period, the customer must provide a Purchase Order Number before
repairs can be initiated. The customer will be billed for parts and
labor for the repair, as well as for shipping.
To determine your nearest authorized service facility, contact the
Customer Service Department or your field office. All products
returned for repair should be identified by the model and serial
numbers and include a description of the defect or failure, name
and phone number of the user, and, in the case of products returned to the factory, a Return Authorization Number (RAN).
The RAN may be obtained by contacting the Customer Service
Department in New York, tel. (914)578-6061, in Geneva, tel.
(41)22/719 21 11, or your nearest sales office.
Return shipments should be made prepaid. LeCroy will not accept
C.O.D. or Collect Return Shipments. Air-freight is generally recommended. Wherever possible, the original shipping carton
should be used. If a substitute carton is used, it should be rigid and
be packed such that the product is surrounded with a minimum of
four inches of excelsior or similar shock-absorbing material. In
addressing the shipment, it is important that the Return Authoriza-
tion Number be displayed on the outside of the container to ensure
its prompt routing to the proper department within LeCroy.
2
ABOUT REMOTE CONTROL
Two modes of operation are available in the oscilloscope. The in-
strument may be operated either manually, by using the
front-panel controls, or remotely by means of an external control-
ler (which is usually a computer, but may be a simple terminal).
This Remote Control Manual describes how to control the oscillo-
scope in the remote mode. For explanations on how to manually
set front-panel controls, refer to the Operator’s Manual.
The oscilloscope is remotely controlled via either the GPIB (Gen-
eral Purpose Interface Bus) or the RS-232-C communication
ports. Whenever the rear-panel GPIB address switches are set be-
tween 0 and 30, control is via GPIB; when they are at 31 or above,
control is via RS-232-C. The instrument can be fully controlled in
remote mode. The only actions which cannot be performed re-
motely are switching on the instrument or setting the remote
address.
This section introduces the basic remote control concepts which
are common to both RS-232-C and GPIB. It also presents a brief
description of remote control messages.
Sections 3 and 4 explain how to send program messages over the
GPIB or the RS-232-C interfaces, respectively. Section 5 alphabetically lists all the remote control commands. Section 6 is a
detailed description and tutorial of the transfer and format of
waveforms, whereas Section 7 explains the use of status bytes for
error reporting. Appendix A shows some complete programming
examples. Appendix B contains a printout of a waveform tem-
plate.
GPIB IMPLEMENTATION
STANDARD
PROGRAM MESSAGES
1.ANSI/IEEE Std. 488.2-1987, "IEEE Standard Codes, Formats, Protocols, and Common Commands", The
Institute of Electrical and Electronics Engineers Inc., 345 East 47th Street, New York, NY 10017, USA.
The remote commands conform to the GPIB IEEE 488.2 stan-
1.
dard
IEEE 488.1 standard which dealt mainly with electrical and me-
chanical issues. The IEEE 488.2 recommendations have also
been adopted for RS-232-C communications whenever applica-
ble.
To remotely control the oscilloscope the controller must send pro-
gram messages which conform to precise format structures. The
instrument will execute all program messages which are in the cor-
rect form and ignore those where errors are detected.
This standard may be seen as an extension of the
About Remote Control
Warning or error messages are normally not reported by the instrument, unless the controller explicitly examines the relevant status
register, or if the status enable registers have been set in such a way
that the controller can be interrupted when an error occurs. The
status registers are explained in Section 7.
During the development of the control program it is possible to
observe all remote control transactions, including error messages,
on an external monitor connected to the RS-232-C port. Refer to
the command "COMM_HELP" for further details.
COMMANDS
AND QUERIES
Program messages consist of one or several commands or queries.
A command directs the instrument to change its state, e.g. to
change its time base or vertical sensitivity. A query asks the instrument about its state. Very often, the same mnemonic is used for a
command and a query, the query being identified by a <?> after
the last character.
For example, to change the time base to 2 msec/div, the controller
should send the following command to the instrument
TIME DIV 2 MS
To ask the instrument about its time base, this query should be
sent
TIME DIV?
A query causes the instrument to send a response message. The
control program should read this message with a "read" instruc-
tion to the GPIB or RS-232-C interface of the controller. The
response message to the query above might be
TIME DIV 10 NS
m
The portion of the query preceding the question mark is repeated
as part of the response message. If desired, this text may be suppressed with the command "COMM_HEADER".
Depending on the state of the instrument and the computation to
be done, the controller may have to wait up to several seconds for
a response. Command interpretation does not have priority over
other oscilloscope activities. It is therefore judicious to set the controller IO timeout conditions to 3 or more seconds. In addition, it
must be remembered that an incorrect query message will not generate a response message.
4
About Remote Control 2
LOCAL AND REMOTE
STATE
PROGRAM MESSAGE
FORM
As a rule, remote commands are only executed by the instrument
when it is in the REMOTE state, whereas queries are always executed. A few commands which don’t affect the state of the front
panel are also executed in LOCAL (refer to the beginning of Section 5 for a list of these commands). When the instrument is in
REMOTE, all front-panel controls are disabled, except the lefthand menu buttons, the intensity controls (which can be disabled
with the command "INTENSITY") and the LOCAL button
(which can be disabled by setting the instrument to LOCAL
LOCKOUT). For an explanation on how to set the instrument to
LOCAL, REMOTE or LOCAL LOCKOUT, refer to Section 3 for
GPIB and to Section 4 for RS-232-C.
An instrument is remotely controlled with program messages
which consist of one or several commands or queries, separated by
semicolons <;> and ended by a terminator:
<command/query>; .........
Upper and/or lower case characters can be used for program messages.
The instrument does not decode an incoming program message
before a terminator has been received (exception: if the program
message is longer than the 256 byte input buffer of the instrument,
the oscilloscope starts analyzing the message when the buffer is
full). The commands or queries are executed in the order in which
they are transmitted.
In GPIB mode, the following are valid terminators:
<NL>New-line character (i.e. the ASCII new-line
character, whose decimal value is 10).
<NL> <EOI> New-line character with a simultaneous <EOI>
signal.
<EOI><EOI> signal together with the last character of
the program message.
Note: The <EOI> signal is a dedicated GPIB interface line which
can be set with a special call to the GPIB interface driver. Refer to
the GPIB interface manufacturer’s manual and support programs.
The <NL> <EOI> terminator is always used in response messages
sent by the instrument to the controller.
In RS-232-C, the terminator may be defined by the user with the
command "COMM_RS232". The default value is <CR>, i.e. the
ASCII carriage return character, the decimal value of which is 13.
;<command/query> <terminator>
About Remote Control
|
|
Examples
COMMAND/QUERY
FORM
Example
GRID DUALThis program message consists of a
single command which instructs the
instrument to display a dual grid.
The terminator is not shown since it
is usually automatically added by
the interface driver routine which
writes to the GPIB (or RS-232).
BWL ON; DISPLAY OFF; DATE?
This program message consists of
two commands, followed by a
query. They instruct the instrument
to turn on the bandwidth limit, turn
off the display, and then ask for the
current date. Again, the terminator
is not shown.
The general form of a command or a query consists of a command
header <header> which is optionally followed by one or several
parameters <data> separated by commas:
<header>[?] <data> .....
The notation [?] shows that the question mark is optional (turning
the command into a query). The detailed listing of all commands
in Section 5 indicates which commands may also be queries.
There is a space between the header and the first parameter.
There are commas between parameters.
DATE 15,OCT,1989,13,21,16
<data>
This command instructs the oscillo-
scope to set its date and time to 15
OCT 1989, 13:21:16. The command header "DATE" indicates
the action, the 6 data values specify
it in detail.
|
|
|
|
I
1
I
|
|
|
1
Header
6
The header is the mnemonic form of the operation to be per-
formed by the oscilloscope. All command mnemonics are listed in
alphabetic order in Section 5.
The majority of the command/query headers have a long form for
optimum legibility and a short form for better transfer and decoding speed. The two forms are fully equivalent and can be used
interchangeably. For example, the following two commands for
switching to the automatic trigger mode are fully equivalent:
TRIG_MODE AUTO and TRMD AUTO
|
1
|
|
|
About Remote Control 2
Some command/query mnemonics are imposed by the IEEE
488.2 standard. They are standardized so that different instruments present the same programming interface for similar
functions. All these mnemonics begin with an asterisk <*>, e.g.
the command "*RST" is the IEEE 488.2 imposed mnemonic for
resetting the instrument, whereas "*TST?" instructs the instrument to perform an internal self-test and to report the outcome.
Header path
Example
Some commands or queries apply to a sub-section of the oscilloscope, e.g. a single input channel or a trace on the display. In such
cases, the header must be preceded by a path name that indicates
the channel or trace to which the command applies. The header
path normally consists of a 2-letter path name followed by a colon
<:> which immediately precedes the command header.
Usually one of the waveform traces can be specified in the header
path (refer to the individual commands listed in Section 5 for details on which values apply to a given command header):
C1, C2
C3, C4
MC, MD
FE, FFFunction E and F
EA, EB
EX, EX10External trigger
CI:OFST -300 MVSet the offset of Channel 1 to
Header paths need only be specified once. Subsequent commands
whose header destination is not indicated are assumed to refer to
the last defined path. For example, the following commands are
identical:
C2:VDIV?; C2:OFST?
C2:VDIV?; OFST?
Channels 1 and 2
Channels 3 and 4 (in 4-channel instruments)
Memory C and D
Expand A and B
-300 mV
What is the vertical sensitivity and
the offset of channel 2?
Same as above, without repeating
the path.
Data
Whenever a command/query uses additional data values, they are
expressed in terms of ASCII characters. There is a single excep-
tion: the transfer of waveforms with the command/query
"WAVEFORM", where the waveform may be expressed as a sequence of binary data values. Refer to Section 6 for a detailed
explanation of the format of waveforms.
ASCII data can have the form of character, numeric, string or
block data.
About Remote Control
|
|
Character data
Numeric Data
These are simple words or abbreviations for the indication of a
specific action.
BANDWIDTH LIMIT ONThe data value "ON" indicates that
the bandwidth limit should be
turned on, rather than off.
In some commands, where as many as a dozen different parame-
ters can be specified, or where not all parameters apply at the same
time, the format requires pairs of data values. The first one names
the parameter to be modified and the second gives its value. Only
those parameter pairs to be changed need to be indicated.
HARDCOPY_SETUP DEV,HP7470A,PORT,GPIB,PSIZE,A4
Three pairs of parameters are specified. The first specifies the device
as the H7470A plotter (or compatible), the second indicates the
GPIB port and the third requests
the A4 format for paper size. While
the command "HARDCOPY SET-
UP" allows many more parameters,
they are either not relevant for plot-
ters or they are left unchanged.
The numeric data type is used to enter quantitative information.
Numbers can be entered as integers, as fractions or in exponential
representation.
EA:VPOS -5Move the displayed trace of Expand A down-
wards by 5 divisions.
C2"OFST 3.56 Set the DC offset of Channel 2 to 3.56 V.
TDIV 5.0E-6 Adjust the time base to 5 issec/div.
Note: Numeric values may be followed by multipliers and units,
modifying the value of the numerical expression. The following
mnemonics are recognized:
|
|
|
|
|
|
|
|
|
II
|
II
II
II
|
|
i
About Remote Control 2
I
EX
l
l
I
T1E 12Tera-G1E9Giga-
MA1E6Mega-K1E3kilo-
M
N1E-9nano-PI1E-12
F1E-15femto-A1E-18atto-
For example, there are many ways of setting the time base of the
instrument to 5 ~tsec/div:
TDIV 5E-6
1E18
1E-3milli-U1E-6micro-
I
TDIV 5 US
l
TDIV 5000 NS
TDIV 5000E-3 US
String Data
This data type enables the transfer of a (long) string of characters
as a single parameter. String data are formed by simply enclosing
any sequence of ASCII characters between simple or double
quotes.
MESSAGE ’Connect probe to point J3’
The instrument displays this message in the Message field above
the grid.
Exa-
PE
Exponential notation, without any
suffix.
Suffix multiplier "U" for 1E-6,
with the (optional) suffix "S" for
seconds.
1E15
Peta-
pico-
Block Data
RESPONSE MESSAGE
FORM
These are binary data values coded in hexadecimal ASCII, i.e.
4-bit nibbles are translated into the digits 0,...9, A .... F and trans-
mitted as ASCII characters. They are only used for the transfer of
waveforms (command "WAVEFORM") and of the instrument
configuration (command "PANEL_SETUP")
The instrument sends a response message to the controller, as an
answer to a query. The format of such messages is the same as that
of program messages, i.e. individual responses in the format of
commands, separated by semicolons <;> and ended by a terminator. They can be sent back to the instrument in the form in which
they are received, and will be accepted as valid commands. In
GPIB response messages, the <NL> <EOI> terminator is always
used.
For example, if the controller sends the program message:
TIME_DIV? ;TRIG_MODE NORM;C 1 :COUPLING? (terminator
not shown)
About Remote Control
|
|
the instrument might respond as follows:
TIME_DIV 50 NS;C 1:COUPLING D50 (terminator not shown)
The response message only refers to the queries, i.e.
"TRIG_MODE" is left out. If this response is sent back to the
instrument, it is a valid program message for setting its time base to
50 nsec/div and the input coupling of Channel 1 to 50 ~.
Whenever a response is expected from the instrument, the control
program must instruct the GPIB or RS-232-C interface to read
from the instrument. If the controller sends another program message without reading the response to the previous one, the
response message in the output buffer of the instrument is discarded.
The instrument uses somewhat stricter rules for response messages
than for the acceptance of program messages, Whereas the con-
troller may send program messages in upper or lower case
characters, response messages are always returned in upper case.
Program messages may contain extraneous spaces or tabs (white
space), response messages do not. Whereas program messages
may contain a mixture of short and long command/query headers,
response messages always use short headers as a default. However,
the instrument can be forced with the command
"COMM_HEADER" to use long headers or no headers at all. If
the response header is omitted, the response transfer time is mini-
mized, but such a response could not be sent back to the
instrument again. In this case suffix units are also suppressed in the
response.
If the trigger slope of Channel 1 is set to negative, the query
"CI:TRSL?" could yield the following responses:
CI:TRIG_SLOPE NEG
CI:TRSL NEG
NEG
Waveforms which are obtained from the instrument using the
query "WAVEFORM?" constitute a special kind of response mes-
sage. Their exact format can be controlled with the commands
"COMM FORMAT" and "COMM ORDER", as explained in
Section ~
header format: long
header format: short
header format: off
|
|
|
|
|
|
|
|
|
|
|
|
|
10
|
|
|
|
GPIB OPERATION
I
3
|
This section describes how to remotely control the oscilloscope via
the GPIB. Topics discussed include interface capabilities, addressing, standard bus commands, and polling schemes.
GPIB STRUCTURE
INTERFACE
CAPABILITIESThe interface capabilities of the oscilloscope include the following
The GPIB is like an ordinary computer bus, except that it interconnects independent devices via a cable bus whereas a computer
has its circuit cards interconnected via a backplane bus. The GPIB
carries program messages and interface messages:
¯Program messages, often called device-dependent messages,
contain programming instructions, measurement results, instrument status and waveform data. Their general form is
described in Section 2.
¯
Interface messages manage the bus itself. They perform functions such as initializing the bus, addressing and unaddressing
devices and setting remote and local modes.
Devices on the GPIB can be listeners, talkers, and/or controllers.
A talker sends program messages to one or more listeners. A controller manages the flow of information on the bus by sending
interface messages to the devices.
The oscilloscope can be a talker or a listener, but not a controller.
The host computer, however, must be able to act as a listener,
talker and controller. For details on how the controller configures
the GPIB for specific functions, refer to the GPIB interface manufacturer’s manual.
IEEE 488.1 definitions:
AH1
SH1
L4
T5
SR1
RL1
DC1
DT1
PP1
CO
E2
Complete Acceptor Handshake
Complete Source Handshake
Partial Listener Function
Complete Talker Function
Complete Service Request Function
Complete Remote/Local Function
Complete Device Clear Function
Every device on the GPIB has an address. When the thumbwheel
address switches on the rear panel of the oscilloscope are set to a
value between 0 and 30, the instrument can be controlled via
GPIB. When the switches are set to above 30, the instrument can
execute talk-only operations on the GPIB, for example driving a
GPIB plotter. In this case no controller is present and the instrument is directly connected to the plotter. Addresses above 30 also
enable the instrument to be controlled via the RS-232-C port.
The instrument reads the address switches once at power on, or
when the RESET button on the rear panel is pressed. If the address is changed during operation, the instrument must be
powered again to enable the new address. The value of the GPIB
address appears in the menu "Auxiliary Setups".
If the oscilloscope is addressed to talk, it will remain configured to
talk until a universal untalk command (UNT), its own listen ad-
dress (MLA), or another instrument’s talk address is received.
Similarly, if the oscilloscope is addressed to listen, it will remain
configured to listen until a universal unlisten command (UNL),
its own talker address (MTA) is received.
The bus system consists of 16 signal lines and 8 ground or shield
lines. The signal lines are divided into 3 groups:
¯
8 data lines
¯
3 handshake lines
¯
5 interface management lines
II
n
i
l
l
l
II
II
Data Lines
Handshake Lines
Interface Management Lines
12
The eight data lines, usually called DI01 through DI08, carry both
program and interface messages. Most of the messages use the
7-bit ASCII code, in which case DI08 is unused.
These three lines control the transfer of message bytes between
devices. The process is called a three-wire interlocked handshake
and it guarantees that the message bytes on the data lines are sent
and received without transmission error.
The following five lines manage the flow of information across the
interface.
ATN (ATteNtion): The controller drives the ATN line true when
it uses the data lines to send interface messages such as talk and
listen addresses or a device clear (DCL) message. When ATN
false, the bus is in the data mode for the transfer of program messages from talkers to listeners.
IFC (InterFace Clear): The controller sets the IFC line true
initialize the bus.
II
II
II
n
II
g
g
II
n
|
|
GPIB Operation 3
REN (Remote ENable): The controller uses this line to place devices in remote or local program mode.
SRQ (Service ReQuest): Any device can drive the SRQ line true
to asynchronously request service from the controller. This is the
equivalent of a single interrupt line on a computer bus.
EOI (End Or Identify): This line has two purposes. The talker
uses it to mark the end of a message string. The controller uses it to
tell devices to identify their response in a parallel poll (discussed
later in this section).
I/O Buffers
IEEE 488.1
STANDARD MESSAGES
The instrument has a 256-byte input buffer and a 256-byte output
buffer. An incoming program message is not decoded before a
message terminator has been received. However, if the input buffer becomes full (because the program message is longer than the
buffer), the instrument starts analyzing the message. In this case
data transmission is temporarily halted, and the controller may
generate a timeout if the limit was set too low.
The IEEE 488.1 standard specifies not only the mechanical and
electrical aspects of the GPIB, but also the low-level transfer pro-
tocol, e.g. it defines how a controller addresses devices, turns
them into talkers or listeners, resets them or puts them in the remote state. Such interface messages are executed with the
interface management lines of the GPIB, usually with ATN true.
All of these messages (except GET) are executed immediately
upon reception and not in chronological order with normal com-
mands.
Note: In addition to the IEEE 488.1 interface message standards,
the IEEE 488.2 standard specifies some standardized program
messages, i.e. command headers. They are identified with a leading asterisk <*> and are listed among the commands in Section 5.
The command list in Section 5 does not contain any command for
clearing the input/output buffers or for setting the instrument to
the remote state. This is because such commands are already spe-
cified as IEEE 488.1 standard messages. Refer to the GPIB
interface manual of the host controller as well as to its support
programs which should contain special calls for the execution of
these messages.
The following describes those IEEE 488.1 standard messages
which go beyond mere reconfiguration of the bus and which have
an effect on the operation of the instrument.
Device Clear
In response to a universal Device CLear (DCL) or a Selected Device Clear message (SDC), the oscilloscope clears the input/output
13
GPIB Operation
buffers, aborts the interpretation of the current command (if any)
and clears any pending commands. Status registers and status en-
able registers are not cleared. Although DCL has an immediate
effect it can take several seconds to execute this command if the
instrument is busy.
I
I
I
I
Group Execute Trigger
Remote ENable
Local LOckout
Go To Local
The Group Execute Trigger message (GET) causes the oscillo-
scope to arm the trigger system. It is functionally identical to the
"*TRG" command.
This interface message is executed when the controller holds the
Remote ENable control line (REN) true and configures the instrument as a listener. The REMOTE LED on the front panel lights up
to indicate that the instrument is set to the remote mode. All the
front-panel controls are disabled except the left-hand menu but-
tons, the intensity controls and the LOCAL button. The menu
indications on the left-hand side of the screen no longer appear
since menus cannot now be operated manually. Whenever the
controller returns the REN line to false, all instruments on the bus
return to LOCAL. Individual instruments can be returned to LO-
CAL with the Go To Local message (see below).
As a rule, remote commands are only executed when the instru-
ment is in the remote state, whereas queries are always executed.
Local front-panel control may be regained by pressing the LO-
CAL push button, unless the instrument was placed in the Local
LOckout (LLO) mode.
The Local LOckout command (LLO) causes the LOCAL button
on the front panel of the oscilloscope to be disabled. The LLO
command can be sent in local or remote mode but only becomes
effective once the instrument has been set to the remote mode.
The Go To Local message (GTL) causes the instrument to return
to the local mode. All front-panel controls become active and the
menus on the left-hand side of the screen reappear. Thereafter,
whenever the instrument is addressed as a listener it will be imme-
diately set to the remote state again.
Note that a GTL message does not clear the local lockout if it was
set. Thus, whenever the instrument returns to the remote state the
local lockout mode would immediately be effective again.
A command string should not be immediately followed by a GTL
message. Since GTL is executed at once, the instrument may already be returned to the local state before the commands in the
input buffer are interpreted. Therefore, the instrument may refuse
to execute them if they require the instrument to be in REMOTE.
I
I
I
I
I
I
I
I
I
I
I
I
14
I
I
GPIB Operation 3
A safe way to ensure that all commands have been interpreted is to
append a query (e.g. "*STB?") to the command string and to wait
for the response before sending a GTL.
InterFace Clear
PROGRAMMING
GPIB TRANSFERS
Configuring the
GPIB Hardware
The InterFace Clear message (IFC) initializes the GPIB but has
effect on the operation of the oscilloscope.
To illustrate the GPIB programming concepts a number of examples written in BASICA are included in this section. It is assumed
that the controller is IBM-PC compatible, running under DOS,
and that it is equipped with a National Instruments2 GPIB inter-
face card. GPIB programming with other languages such as C or
Pascal is quite similar.
If you use another computer or another GPIB interface, refer to
the interface manual for installation procedures and subroutine
calls similar to those described here.
Check that the GPIB interface is properly installed in the comput-
er. If it is not, follow the installation instructions of the interface
manufacturer. In the case of the National Instruments interface, it
is possible to modify the base I/O address of the board, the DMA
channel number and the interrupt line setting using switches and
jumpers. In our program examples, they are assumed to be left in
their default positions.
Connect the oscilloscope to the computer with a GPIB interface
cable. Set the GPIB address on the rear of the instrument to the
required value. The program examples assume that it is set to 4.
Remember to power the instrument up after setting the GPIB ad-
dress.
Configuring the
GPIB Driver Software
National Instruments Corporation,
2.
The host computer needs an interface driver which handles the
transactions between the user’s programs and the interface board.
In the case of the National Instruments interface, the installation
procedure:
¯ copies the GPIB handler GPIB.COM into the boot directory.
¯ modifies the DOS system configuration file CONFIG.SYS to
declare the presence of the GPIB handler.
¯ creates a sub-directory GPIB-PC.
¯ installs in GPIB-PC a number of files and programs which are
useful for testing and reconfiguring the system, and for writing
user programs.
12109 Technology Boulevard, Austin, Texas 78727
15
GPIB Operation
The following files in the sub-directory GPIB-PC are of particular
use:
IBIC. EXE allows interactive control of the GPIB via functions en-
tered at the keyboard. Use of this program is highly recommended
to anyone who is not familiar with GPIB programming or with the
oscilloscope’s remote commands. An example of the use of
IBIC.EXE is shown in Appendix A.
DECL.BAS is a declaration file that contains code to be included
at the beginning of any BASICA application program. Simple
application programs can be quickly written by appending the
user’s instructions to DECL.BAS and executing the complete file.
IBCONF.EXE is an interactive program which allows inspection
or modification of the current settings of the GPIB handler. To run
IBCONF.EXE, refer to the National Instruments user’s manual.
In the program examples in this section, it is assumed that the
National Instruments GPIB driver GPIB.COM is in its default
state, i.e. that the user has not modified it with IBCONF.EXE.
This means that the interface board can be referred to by the symbolic name ’GPIB0’ and that devices on the GPlB bus with
addresses between 1 and 16 can be called by the symbolic names
’DEVI’ to ’DEV16’.
Note: If you have a National Instruments PC2 interface card rather than PC2A, you must run IBCONF to declare the presence of
this card rather than the default PC2A.
|
|
l
|
II
I
l
II
II
II
Simple Transfers
16
For a large number of remote control operations it is sufficient to
use just 3 different subroutines (IBFIND, IBRD and IBWRT) pro-
vided by National Instruments. The following complete program
reads the time-base setting of the oscilloscope and displays it on
the terminal:
1-99
100
110
120
130
140
150
160
<DECL.BAS>
DEV$="DEV4"
CALL IBFIND(DEV$,SCOPE%)
CMD$="TDIV?"
CALL IBWRT(SCOPE%,CMD$)
CALL IBRD(SCOPE%,RD$)
PRINT RD$
END
II
II
II
II
II
II
II
II
GPIB Operation 3
Explanation
Lines 1 - 99 are a copy of the file DECL.BAS supplied by National
Instruments. The first 6 lines are required for the initialization of
the GPIB handler. The other lines are declarations which may be
useful for larger programs, but are not really required code. The
sample program above only uses the strings CMD$ and RD$ which
are declared in DECL.BAS as arrays of 255 characters.
Note: DECL.BAS requires access to the file BIB.M during the
GPIB initialization. BIB.M is one of the files supplied by National
Instruments, and it must exist in the directory currently in use.
Note: The first 2 lines of DECL.BAS each contain a string
"XXXXX" which must be replaced by the number of bytes which
determine the maximum workspace for BASICA (computed by
subtracting the size of BIB.M from the space currently available in
BASICA). For example, if the size of BIB.M is 1200 bytes and
when BASICA is loaded it reports "60200 bytes free ", you should
replace "XXXXX" by the value 59000 or less.
Lines 100 and 110 open the device "DEV4" and associate with it
the descriptor "SCOPE%". All I/O calls from now on will refer to
"SCOPE%". The default configuration of the GPIB handler recog-
"DEV4"
nizes
If you want to use another GPIB address between 1 and 16, use
the string "DEVx" with x = 1...16. If you want to use another
name, run IBCONF.EXE to declare this name to the handler.
Lines 120 and 130 prepare the command string TDIV? and trans-
fer it to the instrument. The command instructs it to respond with
the current setting of the time base.
Line 140 reads the response of the instrument and places it into
the character string RD$.
Line 150 displays the response on the terminal.
When running this sample program, the oscilloscope will automati-
cally be set to the remote state when IBWRT is executed, and will
remain in that state. Pressing the LOCAL button on the front pan-
el will return the oscilloscope to local mode if the GPIB handler
was modified to inhibit Local LOckout (LLO).
Here is a slightly modified version of the sample program which
checks if any error occurred during GPIB operation:
and associates with it a device with GPIB address 4.
17
GPIB Operation
|
|
Some Additional
Driver Calls
1-99
100
110
120
130
140
150
160
170
180
190
200
210
25O
260
The GPIB status word ISTA%, the GPIB error variable IBERR%
and the count variable IBCNT% are defined by the GPIB handler
and are updated with every GPIB function call. Refer to the Na-
tional Instruments user’s manual for details. The sample program
above would report if the GPIB address of the instrument was set
to a value other then 4. Line 180 resets the instrument to local with
a call to the GPIB routine IBLOC.
Example 2 in Appendix A provides a more useful program which
enables interactive setting and inspection of the front-panel controis as well as archiving and recalling of waveforms. Note that this
program is written with just 7 different GPIB calls.
IBLOC is used to execute the IEEE 488.1 standard message Go
To Local (GTL), i.e. it returns the instrument to the local state.
The programming example above shows its use.
IBCLR executes the IEEE 488.1 standard message Selected De-
vice Clear (SDC).
IBRDF and IBWRTF allow data to be read from GPIB to a file
and data to be written from a file to GPIB respectively. Transferring data directly to or from a storage device does not limit the size
of the data block, but it may be slower than transferring to the
computer memory. Example 2 in Appendix A shows the use of
these calls.
IBRDI and IBWRTI allow data to be read from GPIB to an integer array and data to be written from an integer array to GPIB.
Since the integer array allows storage of up to 64 kilobytes (in BA-
SIC), IBRDI and IBWRTI should be used for the transfer of large
<DECL.BAS>
DEV$=" DEV4"
CALL IBFIND(DEV$,SCOPE%)
CMD$="TDIV?"
CALL IBWRT(SCOPE%,CMD$)
IF ISTA% < 0 THEN GOTO 200
CALL IBRD(SCOPE%,RD$)
IF ISTA% < 0 THEN GOTO 250
PRINT RD$
IBLOC(SCOPE%)
END
PRINT "WRITE ERROR = ";IBERR%
END
PRINT "READ ERROR = ";IBERR%
END
I
II
l
I
il
II
n
l
ii
m
ii
il
II
n
18
ti
II
PROGRAMMING
SERVICE REQUESTS
GPIB Operation 3
data blocks to the computer memory, rather than IBRD or IBWRT
which are limited to 256 bytes by the BASIC string length. Note
that IBRDI and IBWRTI only exist for BASIC, since the function
calls IBRD and IBWRT for more modem programming languages,
such as C, are much less limited in the data block size.
IBTMO can be used to change the time-out value during program
execution. The default value of the GPIB driver is 10 seconds, e.g.
if the instrument does not respond to a IBRD call, IBRD will return
with an error after the specified time.
IBTRG executes the IEEE 488.1 standard message Group Execute Trigger (GET), which causes the oscilloscope to arm the
trigger system.
National Instruments supply a number of additional function calls.
In particular, it is possible to use the so-called board level calls
which allow a very detailed control of the GPIB. The use of such
calls is shown in Example 3 of Appendix A.
When an oscilloscope is used in a remote application, events often
occur asynchronously, i.e. at times that are unpredictable for the
host computer. The most common case is waiting for a trigger after
the instrument has been armed. The controller must wait until the
acquisition is finished before it can read the acquired waveform.
The simplest way of checking if a certain event has occurred is by
continuously or periodically reading the status bit associated with it
until the required transition is detected. Continuous status bit poll-
ing is described in more detail in the sub-section "Instrument
Polls". For a complete explanation of the status bytes refer to Section 7.
A potentially more efficient way of detecting events occurring in
the instrument is the use of the Service Request (SRQ). This GPIB
interrupt line can be used to interrupt program execution in the
controller. Therefore, the controller can execute other programs
while waiting for the instrument. Unfortunately, not all interface
manufacturers support the programming of interrupt service routines. In particular, National Instruments only supports the SRQ
bit within the ISTA% status word. This requires the user to continuously or periodically check this word, either explicitly or with the
function call IBWAIT. In the absence of real interrupt service routines the use of SRQ may not be very advantageous.
In the default state, after power-on, the Service ReQuest is disabled. The SRQ is enabled by setting the Service Request Enable
register with the command "*SRE" and specifying which event
should generate an SRQ. The oscilloscope will interrupt the con-
19
GPIB Operation
3
troller as soon as the selected event(s) occur by asserting the SRQ
interface line. If several devices are connected to the GPIB, the
controller may have to identify which instrument caused the inter-
rupt by serial polling the various devices.
Note: The SRQ bit is latched until the controller reads the STatus
Byte Register (STB). The action of reading the STB with the com-
mand "*STB?" clears the register contents except the MAV bit
(bit 4) until a new event occurs. Service requesting may be dis-
abled by clearing the SRE register ("*SRE 0").
|
|
II
II
l
Example 1
Example 2
To assert SRQ in response to the events "new signal acquired"
or "return-to-local" (pressing the front-panel button LO-
CAL).
These events are tracked by the INR register which is reflected in
the SRE register as the INB summary bit in position 0. Since the bit
position 0 has the value 1, the command "*SRE 1" enables the
generation of SRQ whenever the INB summary bit is set.
In addition, the events of the INR register which may be summa-
rized in the INB bit must be specified. The event "new signal
acquired" corresponds to INE bit 0 (value 1) while the event "re-
turn-to-local" is assigned to INE bit 2 (value 4). The total sum
1+4=5. Thus the command "INE 5" is needed.
CMD$="INE 5;*SRE 1"
CALL IBWRT(SCOPE%,CMD$)
To assert SRQ when soft key 10 is pressed.
The event "soft key 10 pressed" is tracked by the URR register.
Since the URR register is not directly reflected in STB but only in
the ESR register (URR, bit position 6), the ESE enable register
must be set first with the command "*ESE 64" to allow the URQ
setting to be reported in STB. An SRQ request will now be gener-
ated provided that the ESB summary bit (bit position 5) in the SRE
enable register is set ("*SRE 32").
CMD$="*ESE 64;*SRE 32"
CALL IBWRT(SCOPE%,CMD$)
l
I
I
II
l
l
I!
n
II
2O
II
II
II
II
GPIB Operation 3
INSTRUMENT POLLS
Continuous Poll
State transitions occurring within the instrument can be remotely
monitored by polling selected internal status registers. This subsection discusses a number of polling methods which may be used
to detect the occurrence of a given event.
1.Continuous poll
2.Serial poll
Parallel poll
3.
4.*IST poll
To emphasize the differences between these methods, the same
example will be presented in each case, i.e. determining if a new
acquisition has taken place. By far the simplest poll is the continuous poll. The other methods only make sense if interrupt service
routines (servicing the SRQ line) are supported or if multiple devices on GPIB must be monitored simultaneously.
In continuous polling a status register is continuously monitored
until a transition is observed. This is the most straightforward
method for detecting state changes but may be impracticable in
some situations, especially in multiple device configurations.
In the following example, the event "new signal acquired" is ob-
served by continuously polling the INternal state change Register
(INR) until the corresponding bit (in this case bit 0, i.e. value 1)
non-zero to indicate that a new waveform has been acquired.
Reading INR clears it at the same time so that there is no need for
an additional clearing action after a non-zero value has been detected. The command "CHDR OFF" instructs the instrument to
omit any command headers when responding to a query. This simplifies the decoding of the response. The instrument would
therefore send "1" rather than "INR 1".
CMD$="CHDR OFF"
CALL IBWRT(SCOPE%,CMD$)
MASK% = 1
LOOP% = 1
WHILE LOOP%
CMD$="INR?"
CALL IBWRT(SCOPE%,CMD$)
CALL IBRD(SCOPE%,RD$)
NEWSIG% = VAL(RD$) AND MASK%
IF NEWSIG% = MASK% THEN LOOP% = 0
WEND
’New Signal Bit has value 1
21
GPIB Operation
3
|
|
Serial Poll
Serial polling takes place once the SRQ interrupt line has been
asserted. The controller examines which instrument has generated
the interrupt by inspecting the SRQ bit in the STB register of each
instrument. Because service request is based on an interrupt mech-
anism, serial polling offers a reasonable compromise in terms of
servicing speed in multiple device configurations.
In the following example, the command "INE 1" enables the
event "new signal acquired" to be reported in the INR to the INB
bit of the status byte STB. The command "*SRE 1" enables the
INB of the status byte to generate an SRQ whenever it is set. The
function call IBWAIT instructs the computer to wait until one of
three conditions occur: &Hg000 in the mask (MASK%) corresponds to a GPIB error, &H4000 to a time-out error and &H0800
to the detection of RQS (ReQuest for Service generated by the
SRQ bit).
Whenever IBWAIT detects RQS it automatically performs a serial
poll to find out which instrument generated the interrupt. It will
only exit if there was a time-out or if the instrument "SCOPE%"
generated SRQ. The additional function call IBRSP fetches the
value of the status byte which may be further interpreted. For this
example to function properly the value of ’Disable Auto Serial
Polling’ must be set ’off’ in the GPIB handler (use IBCONF.EXE
to check).
CMD$="*CLS; INE 1; *SRE 1"
CALL IBWRT(SCOPE%,CMD$)
Note: After the serial poll is completed, the RQS bit in the STB
status register is cleared. Note that the other STB register bits
remain set until they are cleared by means of a "* CLS" command
or the instrument is reset. If these bits are not cleared, they cannot
generate another interrupt.
Serial polling is only an advantage if there are several instruments
that may need attention. Board-level function calls can deal simul-
taneously with several instruments attached to the same interface
board. Refer to the National Instruments user’s manual.
II
II
I
II
II
l
II
l
l
l
II
II
II
22
I
II
|
GPIB Operation 3
Parallel PollParallel polling is only an advantage if there are several instru-
ments that may need attention.
In parallel polling, the controller simultaneously reads the Individ-
ual STatus bit (IST) of all the instruments to determine which one
needs service. Since parallel polling allows up to eight different
instruments to be polled at the same time, parallel polling is the
fastest way to identify state changes of instruments supporting this
capability.
When a parallel poll is initiated, each instrument returns a status
bit via one of the DIO data lines. Devices may respond either individually using a separate DIO line or collectively on a single data
line. Data line assignments are made by the controller via a Parallel Poll Configure (PPC) sequence.
In the following example, the command "INE 1" enables the
event "new signal acquired" in the INR to be reported to the INB
bit of the status byte STB. The PaRallel poll Enable register (PRE)
determines which events will be summarized in the IST status bit.
The command "*PRE 1" enables the INB bit to set the IST bit
whenever it is set. Once parallel polling has been established, the
parallel poll status is examined until a change on data bus line
DI02 takes place.
Stage 1: Enable the INE and PRE registers, configure the con-
troller for parallel poll and instruct the oscilloscope to respond
Note 1: In the example above, board-level GPIB function calls
are used. It is assumed that the controller (board) and oscillo-
scope (device) are respectively located at addresses 0 and 4. The
listener and talker addresses for the controller and oscilloscope
are:
*IST Poll
Logic device
controller
oscilloscope
Note 2: The characters "?" and .... appearing in the command
strings stand for unlisten and untalkrespectively. They are used to
set the devices to a "known" state.
Note 3: To shorten the size of the program examples, device talk-
ing and listening initialization instructions have been grouped into
character chains. They are:
CMDI$ = "?_@$" ’Unlisten, Untalk, PC talker, DSO listener
Note 4: The remote message code for executing a parallel response
in binary form is 01101PPP where PPP specifies the data line.
Since data line 2 is selected, the identification code is 001 which
results in the code 01101001 (binary) or &H69 (hex). See Table
38 of the IEEE 488-1978 Standard for further details.
The state of the Individual STatus bit (IST) returned in parallel
polling can also be read by sending the "* IST?" query. To enable
this poll mode, the oscilloscope must be initialized as for parallel
polling by writing into the PRE register. Since *IST polling emulates parallel polling, this method is applicable in all instances
where parallel polling is not supported by the controller.
Listener address
32 (ASCII<space>)
32+4=36 (ASCII $)
Talker address
64 (ASCII @)
64+4=68 (ASCII D)
24
GPIB Operation 3
In the following example, the command "INE 1" enables the
event "new signal acquired" in the INR to be reported to the INB
bit of the status byte STB. The command "*PRE 1" enables the
INB bit to set the IST bit whenever it is set. The command "CHDR
OFF" suppresses the command header in the response of the instrument, simplifying the interpretation. The status of the IST bit is
then continuously monitored until it is set by the instrument.
CMD$="CHDR OFF; INE 1; *PRE 1"
CALL IBWRT(SCOPE%,CMD$)
LOOP% = 1
WHILE LOOP%
The oscilloscope can be interfaced to a wide range of plotters and
printers and be instructed to directly plot or print the screen con-
tents onto these devices. The devices supported by the unit are
listed with the command "HARDCOPY_SETUP" in Section 5.
When the hard-copy device is connected to the GPIB two different configurations should be considered depending on whether or
not a GPIB controller is available.
When only the oscilloscope and the hard-copy device are connected to the GPIB, the oscilloscope must be configured as
talker-only and the hard-copy device as listener-only to ensure
proper data transfer. The oscilloscope can be configured as a
talker-only by using the thumbwheel switch at the rear of the instrument to select an address larger than 30. The hard-copy
device manufacturer usually specifies an address which forces the
instrument into the listening mode.
¯
Select the oscilloscope’s address to be larger than 30.
¯Switch on the oscilloscope.
¯Configure the "Hardcopy" sub menu in the "Auxiliary Set-
ups" menu specifying "GPIB" as hard copy port.
¯
Put the hard-copy device in listener-only mode.
¯
Press the screen dump button on the front panel of the instrument.
25
GPIB Operation
Plotting/Printing with
a GPIB Controller
1. Data read by controller
and sent to printer/plotter
If a controller is connected to the GPIB, data transfers must be
supervised by the controller. The oscilloscope must be set to an
address between 0 and 30 which differs from the controller’s and
the hard-copy device’s address. Different schemes can be used to
transfer the screen contents:
1. The controller reads the data into internal memory and then
sends them to the printer/plotter. This alternative can be
done with simple high-level GPIB function calls.
2. The oscilloscope sends data to both the controller and the
printer/plotter.
3. The controller goes into a standby state. The oscilloscope
becomes a talker and sends data directly to the printer/plotter.
The controller stores the full set of printer/plotter instructions and
sends them afterwards to the graphics device. This method is the
most straightforward way of transferring screen contents but it requires a large amount of buffer storage (110K for 4 traces).
CMD$ = "SCDP"
CALL IBWRT(SCOPE%,CMD$)
FILE$="PLOT.DAT"
CALL IBRDF(SCOPE%,FILE$)
CALL IBWRTF (PLOTTER%,FILE$)
|
|
n
i
i
I
i
m
I
I
l
2. Oscilloscope sends data to
controller and printer/plotter
26
The oscilloscope puts the printer/plotter instructions on to the bus.
The data is directly plotted out and saved in scratch memory in the
controller. The contents of the scratch file can be deleted later on.
Note 2: The characters "?" and " " appearing in the command
strings stand for unlisten and untalk’respectively. They are used to
set the devices to a "known" state.
Note 3: To shorten the size of the program examples, device talk-
ing and listening initialization instructions have been grouped into
character chains. They are:
CMDI$ = "?_@$" ’Unlisten, Untalk, PC talker, DSO listener
CMD2$ = "? D" ’Unlisten, Untalk, PC listener, DSO talker
27
i
i
n
II
i
n
I
m
II
l
i
II
I
n
I
II
II,
II
4
RS-232-C OPERATION
I
INTRODUCTION
Notation
Example
RS-232-C
PIN ASSIGNMENTS
LeCroy oscilloscopes may be remotely controlled using a host, either a terminal or a computer, via the RS-232-C port. For this
purpose the oscilloscope must be set at an address higher than 30
using the thumbwheel switch at the rear of the instrument.
All the commands described in Section 5 are supported but wave-
form transfer is only possible in HEX mode. The default value
for COMM_FORMAT is set appropriately. The syntax of the response to WF? is identical to the GPIB case.
In this section some special RS-232-C commands are defined either for configuring the oscilloscope, or simulating GPIB 488.1
messages such as setting the oscilloscope into remote or local
modes.
Throughout this section, characters which cannot be printed in
ASCII will be represented by their mnemonics.
<LF>
<BS>
CTRL U
The remote RS-232-C pin assignments (indicated on the rear
panel) are as follows:
Pin #
2T X DTransmitted data (from the oscilloscope).
3
4RTSRequest to send (from the oscilloscope).
5
20
is the ASCII line feed character whose decimal value is
10
is the ASCII backspace character whose decimal value
is 8
means that the control key and the U key are pressed
simultaneously.
Description
R × DReceived data (to the oscilloscope).
If the software Xon/Xoff handshake is selected it is always TRUE.
Otherwise (hardware handshake) it is TRUE
when the oscilloscope is able to receive char-
acters and FALSE when the oscilloscope is
unable to receive characters.
CTSClear to send (to the oscilloscope).
When true, the oscilloscope can transmit,
when false, transmission stops. It is used for
the oscilloscope output hardware handshake.
DTRData terminal ready (from oscilloscope).
Always TRUE.
29
RS-232-C Operation
RS-232-C
CONFIGURATION
1GNDProtective Ground.
7SIG GND Signal Ground.
The RS-232-C port is configured in full duplex. This means that
the two sides (i.e. the controller and the oscilloscope) can both
send and receive messages at the same time. However, when the
oscilloscope receives a new command, it stops outputting.
Transmission of long messages to the oscilloscope should be done
while the oscilloscope is in a triggered mode with no acquisition
in progress. This is especially important when sending waveforms
or front-panel setups into the oscilloscope.
The behavior of the RS-232-C port may be set according to the
user’s needs. For this purpose, in addition to the basic setup on
the front-panel menu there are "immediate commands" as well
as a special command "COMM RS232". Immediate commands
consist of the ASCII ESCape character <ESC> (whose decimal
value is 27), followed by another character. Such commands are
interpreted as soon as the second character has been received.
Note: The RS-232-C baud rate, parity, character length and
number of stop bits are among the parameters that are saved or
recalled by the front-panel "SAVE" or "RECALL" button, or by
the remote commands "*SAV’, "*RCL" or "PANEL SETUP".
When recalling, care must be taken to ensure that these parame-
ters are set at the same value as the actual ones. Otherwise, the
host may no longer be able to communicate with the oscilloscope
and a manual reconfiguration would be necessary.
Echo of Received Characters
by the Oscilloscope
Handshake Control
30
The serial port may echo the received characters. Echo is useful if
the oscilloscope is attached to a terminal. Echoing can be turned
on or off by sending the two character sequence <ESC>] or
<ESC>[ respectively. Echoing is on by default.
Note: The host must not echo characters received from the oscilloscope.
When the oscilloscope input buffer becomes almost full, the instrument sends a handshake signal to the host telling it to stop
transmitting. When this buffer has enough room to receive more
characters another handshake signal will be sent. The handshake
signals are either the CTRL-S (or <XOFF>) and CTRL-Q
(<XON>) characters or a signal level on the RTS line (pin 4).
is selected by sending the two-character sequence <ESC>) for
XON/XOFF handshake - this is the default - or <ESC>( for RTS
handshake.
|
|
RS-232-C Operation 4
The flow of characters coming from the oscilloscope may be controlled either by a signal level on the CTS line (pin 5) or by the
<XON>/<XOFF> pair of characters.
Editing Features
Message Terminators
Examples
When the oscilloscope is directly connected to a terminal, the following features will facilitate the correction of typing errors:
<BS> or <DELETE>Delete the last character.
CTRL UDelete the last line.
"Message terminators" are markers that indicate to the receiver
that a message has been completed.
On input to the oscilloscope, the Program Message Terminator
is one character which can be selected by the user. A good choice
would be a character that is never used for anything else. The
character is chosen using the command COMM_RS232 and the
keyword EI. The default Program Message Terminator is the
ASCII character <CR>, whose decimal value is 13.
The oscilloscope appends a Response Message Terminator to the
end of each of its responses. It is a string, like a computer prompt,
chosen by the user. This string must not be empty. The default
Response Message Terminator is "\n\r" which means
<LF><CR>.
COMM_RS232 EI,3
This command informs the oscilloscope that each message it
receives will be terminated with the ASCII character <ETX>
which corresponds to 3 in decimal.
(2) COMM_RS232 EO,"\r\nEND\r\n"
This command indicates to the oscilloscope that it must ap-
pend the string "\r\nEND\r\n" to each response.
After these settings, a host command will look like:
TDIV?<ETX>
The oscilloscope responds:
TDIV 1. S
END
Note: Having sent a COMM_RS232 command, the host must wait
for the oscilloscope to change its behavior before sending a com-
mand in the new mode. A safe way to do this is to include a query
on the line which contains the COMM_RS232 command and wait
until the response is received. For example,
COMM RS232 EI,3; *STB?
31
RS-232-C Operation
SRQ Message
Example
Long Line Splitting
Each time the Master Summary Status (MSS) bit of the STatus
Byte (STB) is set, the SRQ message (a string of characters) is
to the host to indicate that the oscilloscope requests service. The
RS-232-C SRQ message has the same meaning as the GPIB SRQ
message. If the string is empty, no message will be sent. This is the
default setting. Note that no response message terminator is added
at the end of the SRQ message.
COMM_RS232 SRQ,"\r\n\nSRQ\r\n\a"
When the MSS bit is set, the oscilloscope will send
a <CR> followed by 2 <LF>s
SRQ
a <CR> followed by 1 <LF>
and the buzer will sound.
Line splitting is a feature provided for hosts that cannot accept
lines with more than a certain number of characters. The oscillo-
scope may be configured to split responses into many lines. This
feature is very useful for waveform or front-panel setup transfers
although it is applicable to all response messages. Two parameters
control this feature:
Line Separator: Offmessages will not be
split into lines
<CR>,<LF> or <CR><LF> possible line termi-
nators.
the maximum number of characters in a line.Line length:
Example
Remarks
32
COMM_RS232 LS,LF,LL,40
The line separator is the ASCII character <LF>, the line is a maxi-
mum of 40 characters long (excluding the line separator).
If the oscilloscope receives the command PNSU?, it may answer:
Long commands sent to the oscilloscope may not be split into
lines. If a command sent to the oscilloscope is the response to a
previous query, the line split characters (<LF> and/or <CR>) must
be removed.
COMMANDS SIMULATING
GPIB COMMANDS
<ESC>C or <ESC>c
Device clear command.
<ESC>R or <ESC>r
Set to remote command
(REN)
<ESC>L or <ESC>I
Set to local command
RS-232-C Operation 4
This also applies to line split characters inside strings sent to the
oscilloscope.
However, hex-ASCII data sent to the oscilloscope may contain
line split characters. If you wish to use line splitting, ensure that
neither the input message terminator characters nor the line split
characters occur in the data.
This command clears the input and output buffers. It has the same
meaning as the GPIB DCL or SDC interface messages.
This command puts the oscilloscope into the remote mode. Its
function is the same as GPIB asserting the REN line and setting the
oscilloscope to listener.
This command puts the oscilloscope into local mode. It clears local
lockout. It has the same function as GPIB setting the REN line to
false.
<ESC>F or <ESC>f
Set local lockout command
<ESC>T or <ESC>t
Trigger command (GET)
This command disables the front-panel "LOCAL" button either
immediately if the oscilloscope is already in the remote mode or
later when the oscilloscope is next set to remote control. This disabling of the front-panel "LOCAL" button is called "Local
Lockout" and can only be cancelled with the <ESC>L command.
<ESC>F has the same meaning as the GPIB LLO interface message.
This command rearms the oscilloscope while it is in "SINGLE" or
in "SEQUENCE" mode (valid only while the oscilloscope is in the
remote mode). It has the same meaning as the "*TRG" command, and also the same meaning as the GPIB GET interface
message.
33
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5
ISYSTEM COMMANDS
ORGANIZATION
COMMAND SUMMARY
This section of the manual lists all commands and queries recognized by the oscilloscope. For easy reference the listings are
arranged in alphabetical order. Each command starts on a new
page and the name (header) of the command is given in both the
long and short forms. Below each name (header) it is indicated
whether it denotes a command only, a command as well as a
query, or a query only. For those headers that may be used to
command an action, for example to modify a setup parameter, or
to obtain some information such as the current value of a setup
parameter, the query form is derived by appending a question
mark (?) immediately to the header without intervening spaces.
The description of each command starts with a short explanation
of the function performed by it, followed by a presentation of the
formal syntax. In the formal syntax the header appears in mixed
mode characters with the characters used to construct the short
form shown in upper case.
Where applicable, the syntax of the query form is given along with
the format of the response the oscilloscope will produce.
For most commands the description terminates with a short exam-
ple illustrating a typical use of the command. The GPIB examples
assume that the controller is equipped with a National Instruments
interface board, and they show calls to the National Instruments
interface subroutines in BASIC. The device name of the oscillo-
scope has been defined as "SCOPE%".
The following is an overview of the commands grouped according
to their functionality.
Acquisition
Communication
To control the acquisition of waveforms:
ARM_ACQUISITION, AUTO_SETUP, BANDWIDTH_LIMIT,
INTERLEAVED, SAMPLE_CLOCK, SEGMENTS, STOP,
*TRG, WAIT.
To select vertical input parameters to capture waveforms:
ATFENUATION, COUPLING, OFFSET, VOLT_DIV.
To select time-base parameters to capture waveforms:
TIME_DIV, TRIG_DELAY.
To select trigger conditions to capture waveforms:
To control the calibration and test the instrument:
AUTO_CALIBRATE, *CAL?, *TST?.
To control the built-in buzzer:
BUZZER.
To control the real-time clock:
DATE.
II
II
II
II
II
System Commands 5
To delete a file from the memory card:
DELETE_FILE
To obtain a directory listing of the memory card:
DIRECTORY_LIST?
To format the memory card:
FORMAT_CARD
To identify the instrument:
*IDN?, *OPT?.
COMMAND EXECUTION
Before attempting to execute a command or query, the oscillo-
scope scans it to verify its correctness and that sufficient
information is given to perform the requested action. To protect
the local user from changes in the oscilloscope’s behavior which
are beyond his control, the remote user must set the oscilloscope
to the remote state to execute commands that affect the operation
of the instrument as an oscilloscope. If such a command is received while the oscilloscope is operating in the local state, an
execution permission error is generated and the execution of the
command is denied. Vice versa, the local user cannnot interfere
with the remote user because all front-panel controls :are disabled
while the oscilloscope is in the remote state.
Since interrogating the oscilloscope does not change its internal
state, it may be queried at any time, independently of local or
remote operation. There are only two exceptions to this rule: the
queries *CAL? and *TST? both recalibrate the oscilloscope and
are therefore executed in the remote state only.
Commands that only affect the remote behavior are executed independently of whether the oscilloscope is in the local or remote
state. In this category are all commands that modify communication parameters (COMM_FORMAT, COMM HEADER,
COMM_HELP, COMM_ORDER, COMM_RS232)~ all com-
mands affecting status information (*CLS, *ESE, INE, *OPC,
* PRE, * SRE, * WAI), and the commands used to display messages
on the screen to the local user (CALL_HOST, KEY, MESSAGE).
In the description of each command, only exceptions to the rule
that a command is executed only in the remote state and a query is
executed in both the local and remote states are mentioned.
COMMAND NOTATION
The following notation is used in the description of the individual
commands :
< > Angular brackets enclose words that are used as placehold-
ers. There are two types of placeholders: (1) the header
path, (2) a data parameter of a command.
37
System Commands
5
A colon followed by an equals sign separates a placeholder
:=
from the description of the type and range of values that may
be used in a command instead of the placeholder.
{ } Braces enclose a list of choices from which one must be se-
lected.
[ ] Square brackets enclose optional items.
...An ellipsis indicates that the items to the left and to the right
of the ellipsis may be repeated zero or more times.
As an example, consider the syntax notation for the command to
set the vertical input sensitivity:
<channel>:VOLT_DIV <v_gain>
<channel> := {C1, C2}
<v_gain> := 5.0 mV to 2.5 V
The first line shows the formal appearance of the command with
<channel> denoting the placeholder for the header path, and
<v_gain> denoting the placeholder for the data parameter specifying the desired vertical gain value. The second line indicates that
either "CI" or "C2" must be chosen for the header path, and the
third line explains that the actual vertical gain can be set to any
value between 5 mV and 2.5 V.
|
|
II
I
II
I
I
l
II
38
II
II
II
II
II
II
II
II
II
System Commands 5
STATUS
DESCRIPTION
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
ALL_STATUS?, ALST?
Query
The ALL_STATUS? query reads and clears the contents of all
status registers: STB, ESR, INR, DDR, CMR, EXR, and URR ex-
cept the MAV bit (bit 6) of the STB register. For an interpretation
of the contents of each register, refer to the appropriate status
register.
The ALL_STATUS? query is useful if a complete overview of the
state of the instrument is required.
ALl_STatus?
ALl STatus STB,<value>,ESR,<value>,INR,<value>,
DDl~,<value>, CMR<value>, EXR,<value>,URR,<value>
<value> := 0 to 65535
The following instruction reads the contents of all the status registers.
The following command sets the attenuation factor of channel 1 to
100.
CMD$="CI:ATTN 100": CALL IBWRT(SCOPE%,CMD$)
$ 4-channel oscilloscopes only
41
System Commands
I
I
MISCELLANEOUS
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response Format
EXAMPLE (GPIB)
AUTO_CALIBRATE, ACAL
Command/Query
The AUTO CALIBRATE command is used to enable or disable
automatic calibration of the instrument. At power-up, auto-cali-
bration is turned ON, i.e. all input channels are periodically
calibrated for the current input amplifier and time-base settings.
The automatic calibration may be disabled by issuing the com-
mand ACAL OFF. Whenever it is convenient, a *CAL? query
may be issued to fully calibrate the oscilloscope. When the oscilloscope is returned to local control, the periodic calibrations will be
resumed.
The response to the AUTO CALIBRATE? query indicates
whether auto-calibration is enabled.
Auto_CALibrate <state>
<state> := {ON, OFF}
Auto_CALibrate?
Auto_CALibrate <state>
The following instruction disables auto-calibration.
CMD$="ACAL OFF": CALL IBWRT(SCOPE%,CMD$)
I
I
I
I
I
I
I
I
I
RELATED COMMANDS
42
*CAL?
I
I
I
I
|
System Commands 5
ACQUISITION
DESCRIPTION
COMMAND SYNTAX
EXAMPLE
AUTO_SETUP, ASET
Command
The AUTO_SETUP attempts to display the input signal(s) by adjusting the vertical, time-base and trigger parameters. Auto-setup
operates only on the channels whose traces are currently turned
on. The only exception occurs when no traces are turned on, in
which case AUTO_SETUP operates on all channels and turns on
all of the traces.
If signals are detected on several channels, the lowest numbered
channel with a signal determines the selection of the time base and
trigger source.
If only one input channel is turned on, the time base will be adjusted for that channel.
Auto_SETup
The following command instructs the oscilloscope to perform an
auto-setup.
CMD$ = "ASET": CALL IBWRT(SCOPE%,CMD$)
43
System Commands
|
|
ACQUISITION
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response Format
EXAMPLE
BANDWIDTH_LIMIT, BWL
Command/Query
The BANDWIDTH LIMIT command enables or disables the
bandwidth limiting low pass filter.
The response to the BANDWIDTH_LIMIT? query indicates if the
bandwidth filter is on or off.
BandWidth_Limit <mode>
<mode> := {ON, OFF}
BandWidth_Limit?
BandWidth_Limit <mode>
The following command turns the bandwidth filter on.
CMD$ = "BWL ON": CALL IBWRT(SCOPE%,CMD$)
II
II
II
II
II
II
II
Ii
44
II
II
II
II
II
II
II
II
System Commands 5
MISCELLANEOUSBUZZER, BUZZ
Command
DESCRIPTION
COMMAND SYNTAX
EXAMPLE (GPIB)
The BUZZER command controls the built-in piezo-electric buzz-
er. This may be useful to attract the attention of a local operator in
an interactive working application. The buzzer may either be activated for short beeps (about 400 msec long in BEEP mode)
continuously for a certain time interval selected by the user by
turning the buzzer ON or OFF. A beep request which immediately
follows another beep request will be held off for approximately
200 msec.
Note: This command is always accepted (local and remote).
BUZZer := {BEEP, ON, OFF}
Sending the following code will cause the oscilloscope to sound two
short tones.
The *CAL? query performs a complete internal calibration. This
calibration sequence is the same as that which occurs at power-up.
At the end of the calibration, the response indicates how the calibration terminated. When the calibration is finished, the
instrument returns to the state it was in prior to the query.
Hardware failures are identified by a unique binary code in the
returned <status> number (see Table 1 ). A "0" response indicates
that no failures occurred.
Note: This query is only accepted in remote mode.
*CAL?
*CAL <diagnostics>
<diagnostics> := 0calibration successful
BIT
0
1
2
3
4
5
BIT VALUE
1CH1 failure
2
4CH3 failure¢
8CH4 failure¢
16TDC failure
32
Failures
Table 1
DESCRIPTION
CH2 failure
Trigger circuit failure
II
l
l
n
n
Ii
n
l
II
II
n
EXAMPLE (GPIB)
RELATED COMMANDSAUTO_CALIBRATE
:1: 4-channel oscilloscopes only, reserved In the 2-channel oscilloscopes
46
The following instruction forces a self-calibration.
CMD$="*CAL?": CALL IBWRT(SCOPE%,CMD$)
CALL IBRD(SCOPE%,RD$): PRINT RD$
Response message (if no failure)
*CAL 0
l
II
II
II
l
System Commands 5
DISPLAYCALL_HOST, CHST
Command/Query
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
The CALL_HOST command allows the user to manually generate
a service request (SRQ). Once the CALL_HOST command has
been received, the message "Call Host" will be displayed next to
the lowest button (10) in the menu field (II). Pressing this button
while in the root menu causes the User Request status Register
(URR) and the URQ bit of the Event Status Register to be set. This
can generate a SRQ in local mode provided that the service request mechanism has been enabled.
The response to the CALL_HOST? query indicates whether call
host is enabled (on) or disabled (off).
Note: This command can be executed in both local and remote
modes.
Call HoST <state>
<state> := {ON, OFF}
Call_HoST?
Call_HoST <state>
After executing the following code an SRQ request will be gener-
ated whenever button 10 is pressed. It is assumed that SRQ
servicing has already been enabled.
CMD$="CHST ON": CALL IBWRT(SCOPE%,CMD$)
RELATED COMMANDS
URR?
47
System Commands
|
|
STATUS
DESCRIPTION
COMMAND SYNTAX
EXAMPLE (GPIB)
RELATED COMMANDS
*CLS
Command
The *CLS command clears all the status data registers.
Note: This command can be executed in both local and remote
modes.
*CLS
The following command causes all the status data registers to be
cleared.
CMD$ =
ALL_STATUS?, CMR?, DDR?, *ESR?, EXR?, *STB?, URR?
"*CLS’’:
CALL IBWRT(SCOPE%,CMD$)
|
|
|
|
II
|
|
|
48
|
|
|
|
|
|
|
|
System Commands 5
STATUS
DESCRIPTION
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
RELATED COMMANDS
CMR?
Query
The CMR? query reads and clears the contents of the CoMmand
error Register (CMR). The CMR register (Table 2) specifies
last syntax error type detected by the instrument.
CMR?
CMR <value>
<value> := 1 to 13
The following instruction reads the contents of the CMR register.
Unrecognized command/query header
Illegal header path
Illegal number
Illegal number suffix
Unrecognized keyword
String error
GET embedded in another message
Arbitrary data block expected
Non-digit character in byte count field of
arbitrary data block
EOI detected during definite length data block
transfer
Extra bytes detected during definite length data
block transfer
Description
PRINT RSP$
Command Error Status Register Structure (CMR)
Table 2
49
System Commands
|
|
COMMUNICATION
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
COMM_FORMAT, CFMT
Command/Query
The COMM_FORMAT command selects the format which the
oscilloscope will use to send waveform data. The available options
allow (1) the block format, (2) the data type and (3) the encoding
mode to be modified from the default settings.
Note: This command can be executed in both local and remote
modes.
The COMM_FORMAT? query returns the currently selected
waveform data format.
(GPIB uses both encoding forms, RS-232-C always uses HEX)
Initial settings (i.e. after power on) are:
DEF9, WORD, BIN for GPIB
DEF9, WORD, HEX for RS-232-C
Comm_ForMaT?
|
|
|
|
|
|
|
|
Response Format
EXAMPLE (GPIB)
EXPLANATION
50
Comm_ForMaT <block_format>,<data_type>,<encoding>
The following code redefines the transmission format of waveform
data. The data will be transmitted as a block of indefinite length.
Data will be coded in binary and represented as 8-bit integers.
CMD$="CFMT IND0,BYTE,BIN"
CALL IBWRT(SCOPE%,CMD$)
BLOCK FORMAT
DEFg:
Uses the IEEE 488.2 definite length arbitrary block response data format. The digit 9 indicates that the byte
count consists of 9 digits. The data block directly follows
the byte count field.
For example, a data block consisting of 3 data bytes
would be sent as:
WF DATI,#9000000003<DAB><DAB><DAB>
where <DAB> represents an 8-bit binary data byte.
|
|
|
|
|
|
II
|
System Commands 5
IND0:Uses the IEEE 488.2 indefinite length arbitrary block
response data format.
A <NL^END> (new line with EOI) signifies that block
transmission has ended.
The same data bytes as above would be sent as:
WF DAT 1,#0<DABxDABxDABxNL^END>
OFF:Same as IND0. In addition, the data block type identi-
fier and the leading #0 of the indefinite length block will
be suppressed. The data presented above would be sent
as:
WF <DAB><DABxDABxNL^END>
Note: The format OFF does not conform to the IEEE 488.2 standard and is only provided for special applications where the
absolute minimum of data transfer may be important.
DATA TYPE
BYTE:Transmits the waveform data as 8-bit signed integers
(1 byte).
WORD:
Note: The data type BYTE transmits only the high order bits of the
internal 16-bit representation. The precision contained in the low
order bits is lost.
Transmits the waveform data as 16-bit signed integers
(2 bytes).
RELATED COMMANDS
ENCODING
BIN:
HEX:Hexadecimal encoding (bytes are convened to 2 hexa-
WAVEFORM?
Binary encoding (GPIB only)
decimal ASCII digits (0 .... 9, A .... F))
51
5 System Commands
|
|
COMMUNICATION
DESCRIPTION
COMM_HEADER, CHDR
Command/Query
The COMM_HEADER command controls the way the oscilloscope will format responses to queries. The instrument provides
three response formats: (1) LONG format, i.e. responses start
with the long form of the header word; (2) SHORT format, i.e.
responses start with the short form of the header word; (3) OFF,
i.e. headers are omitted from the response and suffix units in num-
bers are suppressed. Until the user requests otherwise, the SHORT
response format is used.
This command does not affect the interpretation of messages sent
to the oscilloscope. Headers may be sent in their long or short
form regardless of the COMM_HEADER setting.
Querying the vertical sensitivity of Channel 1 may result in one of
the following responses:
COMM_HEADER
LONG
SHORTCI:VDIV 200E-3 V
OFF200E-3
CHANNEL_I:VOLT_DIV 200E-3 V
RESPONSE
COMMAND SYNTAX
QUERY SYNTAX
Response Format
EXAMPLE (GPIB)
52
Note: This command can be executed in both local and remote
modes.
Comm_HeaDeR <mode>
<mode> := {SHORT, LONG, OFF}
Note: The default mode, i.e. the mode just after power on, is
SHORT.
Comm_HeaDeR?
Comm_HeaDeR <mode>
The following code sets the response header format to short.
CMD$ = "CHDR SHORT"; CALL IBWRT(SCOPE%,CMD$)
System Commands 5
COMMUNICATION
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response Format
EXAMPLE (GPIB)
COMM_HELP, CHLP
Command/Query
The COMM_HELP command enables the help diagnostics utility
to assist remote program debugging. When turned on, this utility
displays all message transactions occurring between the controller
and the oscilloscope on a terminal, printer or similar recording
device connected to the RS-232-C port. Errors detected by the
instrument can be directly viewed.
Note: This command can be executed in both local and remote
modes.
The COMM HELP? query indicates if the diagnostics utility has
been enabled.
Comm_HeLP <target>
<target> := {RS, OFF}
The initial <target>, (i.e. after power on) is OFF.
Comm HELP?
Comm_HeLP <target>
The following code turns on the remote control diagnostics utility.
CMD$="CHLP RS"; CALL IBWRT(SCOPE%,CMD$)
53
System Commands
COMMUNICATION
DESCRIPTION
COMMAND SYNTAX
COMM_ORDER, CORD
Command/Query
The COMM_ORDER command controls the byte order of waveform data transfers. Waveform data may be sent with the most
significant byte (MSB) or the least significant byte (LSB) in
first position. The default mode is the MSB first.
COMM_ORDER applies equally to the waveform’s descriptor and
time blocks. In the descriptor some values are 16 bits long
("word"), 32 bits long ("long " or "float"), or 64 bits long ("dou-
ble"). In the time block all values are floating values, i.e. 32 bits
long. When "COMM_ORDER HI" is selected the most significant
byte is sent first. When "COMM_ORDER LO" is specified the
least significant byte is sent first.
The COMM_ORDER? query returns the byte transmission order
currently in use.
Note: This command can be executed in both local and remote
modes.
Comm ORDer <mode>
<mode> := {HI, LO}
Note: The initial mode, i.e. the mode after power on, is HI.
QUERY SYNTAX
Response Format
EXAMPLE
54
Comm ORDer?
Comm_ORDer <mode>
The order of transmission of waveform data depends on the data
type. Table 3 illustrates the different possibilities.
DESCRIPTIONThe CURSOR_SET command allows the user to position any one
of the eight independent cursors at a given screen location. The
positions of the cursors can be modified or queried even if the
required cursor is not currently displayed on the screen.
When setting a cursor position, a trace must be specified, relative
to which the cursor will be positioned.
The CURSOR_SET? query indicates the current position of the
cursor(s). The values returned depend on the grid type selected.
Note 1: When the oscilloscope is in the dual grid mode, traces are
assigned to either the upper grid (EA, MC, FE, C1, C3~) or lower
grid (EB, MD, FF, C2, C4~). The trace specified determines
whether a vertical cursor will be placed relative to the upper or
lower grid.
In quad grid mode~ each channel is permanently assigned to its
respective grid with C1 at the top and C4 at the bottom. All other
traces may be re-positioned anywhere on the screen using the vertical position control.
:l: 4-channel oscilloscopes only
Note 2: If the parameter display is turned on (or the pass/fail dis-
play or the extended parameters display), the parameters of the
specified trace will be shown unless the newly chosen trace is not
displayed or has been acquired in sequence mode (these conditions will produce an environment error, see Table 6, page 84). To
only change the trace without repositioning the cursors, the CUR-
SOR SET command may be given with no argument, (e.g.
EB:CRST).
Notation
HABS Horizontal absolute
VABS Vertical absolute
HDIF
VDIF
PDIF
Horizontal difference
Vertical difference
Parameter difference
61
HREF Horizontal reference
VREF Vertical reference
PREF Parameter reference
System Commands
COMMAND SYNTAX
QUERY SYNTAX
Response Format
EXAMPLE (GPIB)
<trace>:CuRsor SeT <cursor>,<position>[<cursor>,<position>,
...<cursor>,<po~tion>]
The DDR? query reads and clears the contents of the Device Dependent or device specific error Register (DDR). In the case of
hardware failure, the DDR register specifies the origin of the failure. Refer to Table 4, page 66, for further details.
DDR?
DDR <value>
<value> := 0 to 65535
The following instruction reads the contents of the DDR register.
Note 1: Parameters are grouped in pairs. The first one names the
variable to be modified and the second one gives the new value to
be assigned. Pairs may be given in any order and may be restricted
to the variables to be changed.
Note 2: The pair SWEEPS,<max..sweeps> applies only when averaging (AVGS) has been chosen. Otherwise it is ignored.
The DISPLAY command controls the display screen of the oscilloscope. When the user is remotely controlling the oscilloscope and
does not need to use the display, it may be useful to switch off the
display via the DISPLAY OFF command. This improves instrument response time since the waveform graphic generation
procedure is suppressed.
The response to the DISPLAY? query indicates the display state of
the oscilloscope.
Note: When the display has been set to OFF, the real time clock
and the message field are updated. However, the waveforms and
associated texts remain unchanged.
DiSPlay <state>
<state> := {ON, OFF}
DISPlay?
DISPlay <state>
The following instruction turns off the display generation.
CMD$=’DISP OFF": CALL IBWRT(SCOPE%,CMD$)
|
|
|
|
|
l
|
i
|
78
|
|
|
|
|
|
|
|
System Commands 5
|
DISPLAY
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
RELATED COMMANDS
DUAL_ZOOM, DZOM
Command/Query
By setting DUAL ZOOM ON, the horizontal magnification and
positioning contro’[s apply to all expanded traces simultaneously.
This command is useful if the contents of all expanded traces are
to be examined at the same time.
The DUAL_ZOOM? query indicates whether multiple zoom is enabled or not.
Note: This command has the same effect as MULTIZOOM.
Dual ZOoM <mode>
<mode> := {ON, OFF}
Dual_ZOoM?
Dual ZOoM <mode>
The following example turns dual zoom on.
CMD$="DZOM ON": CALL IBWRT(SCOPE%,CMD$)
HOR_MAGNIFY, HOR_POSITION, MULTIZOOM, ZOOM
79
System Commands
|
II
STATUS
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
*ESE
Command/Query
The *ESE command sets the standard Event Status Enable register (ESE). This command allows one or more events in the ESR
register to be reflected in the ESB summary message bit (bit 5)
the STB register. For an overview of the ESB defined events refer
to the ESR table (Table 5, page 82).
The *ESE? query reads the contents of the ESE register.
Note: This command can be executed in both local and remote
modes.
*ESE <value>
<value> := 0 to 255
*ESE?
*ESE <value>
The following command allows the ESB bit to be set if a user request (URQ bit 6, i.e. decimal 64) and/or a device dependent
error (DDE bit 3, i.e. decimal 8) occurs. Summing these values
yields the ESE register mask 64+8=72.
CMD$="*ESE 72": CALL IBWRT(SCOPE%,CMD$)
n
|
I
|
|
i
|
|
l
RELATED COMMANDS
8O
*ESR?
l
|
i
|
i
|
|
System Commands 5
STATUS
DESCRIPTION
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
RELATED COMMANDS
*ESR?
Query
The * ESR? query reads and clears the contents of the Event Status
Register (ESR). The response represents the sum of the binary
values of the register bits 0 to 7. Refer to Table 5, page 82 for an
overview of the ESR register structure.
*ESR?
*ESR <value>
<value> := 0 to 255
The following instruction reads and clears the contents of the ESR
register.
(1) The Power On (PEN) bit Is always turned on (1) when the unit Is powered
The User Request (URQ) bit is set true (1) when a soft key Is pressed. An associated register URR Identifies
(2)
which key was selected, For further details refer to the URR? query.
The CoMmand parser Error bit (CME) Is set true ( 1 ) whenever a command syntax error Is detected. The
(3)
bit has an associated CoMmand parser Register (CMR) which specifies the error code, Refer to the query
CMR? for further details,
(4)The EXecution Error bit (EXE) Is set true (1) when a command cannot be executed due to some device
condition (e.g. oscilloscope in local state) or a semantic error.The EXE bit has an associated Execution Error
Register (EXR) which specifies the error code. Refer to query EXR? for further details,
(5)The Device specific Error (DDE) Is set true (1) whenever a hardware failure has occurred at power-up
execution time such as a channel overload condition, a trigger or a time-base circuit defect, The origin of the
failure may be localized via the DDR? or the self test *TST? query,
The Query Error bit (QYE) Is set true (1) whenever (a) an attempt Is being made to read data from the
(6)
Queue when no output Is either present or pending, (b) data in the Output Queue has been lost, (c)
output and Input buffers are full (deadlock state), (d) an attempt Is made by the controller to read before
having sent an<END>, (e) a command Is received before the response to the previous query was read (output
buffer flushed).
(7) The ReQuest Control bit (RQC) Is always false (0) since the oscilloscope has no GPIB controlling capability.
(8)The OPeration Complete bit (OPC) Is set true (1) whenever *OPC has been received since commands
queries are strictly executed In sequential order, The oscilloscope starts processing a command only once the
previous command has been entirely executed.
Bit Value
128
64
32
16
8
4
2
1
Bit Name
PeN
URQ
CME
EXE
DDE
QYE
RQC
OPC
Standard Event Status Register (ESR)
Description
0 Reserved by IEEE 488.2
1 a Power off-to-ON transition has occurred
1 a User ReQuest has been issued
1 a CoMmand parser Error has been found
1 an Execution Error has been detected
1 a Device Specific Error has occurred
1 a QueRy Error has occurred
0 The Instrument never requests bus control
0 The OPeration Complete bit Is not used
Table 5
Note
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(a)
I
I
I
I
I
I
I
I
I
I
I
I
I
82
I
I
|
System Commands 5
STATUS
DESCRIPTION
QUERY SYNTAX
Response format
EXAMPLE (GPIB)
RELATED COMMANDS
EXR?
Query
The EXR? query reads and clears the contents of the EXecution
error Register (EXR). The EXR register specifies the type of the
last error detected during execution. Refer to Table 6, page 84 for
further details.
EXR?
EXR <value>
<value> := 21 to 64
The following instruction reads the contents of the EXR register.
CMD$="*EXR?’: CALL IBWRT(SCOPE%,CMD$)
CALL IBRD (SCOPE%,RSP$): PRINT RSP$
Response message (if no fault)
EXR 0
ALL_STATUS?, *CLS
83
System Commands
5
|
1
Value
21
22
23
24
25
26
30
31
32
33
34
35
50
51
52
53
54
55
56
57
58
59
60
61
62
64
Description
Permission error. The command cannot be executed In local mode.
Environment error. The instrument is not configured to correctly process a command.
For instance, the oscilloscope cannot be set to RIS at a slow time base.
Option error. The command applies to an option which has not been installed.
Unresolved parsing error.
Parameter error. Too many parameters specified.
Non-implemented command.
Hex data error. A non-hexadecimal character has been detected in a hex data block.
Waveform error. The amount of data received does not correspond to descriptor indicators.
Waveform descriptor error. An Invalid waveform descriptor has been detected.
Waveform time error. Invalid RIS or TRIG time data has been detected.
Waveform data error, invalid waveform data have been detected.
Panel setup error. An Invalid panel setup data block has been detected.
No memory card present when user attempted to access the card.~
Memory card not formatted when user attempted to access the card.*
Memory card was exchanged when user attempted to RECALL the NEXT, PREVIOUS
or SAME waveform.~,
Memory card was write protected when user attempted to create a file. to delete a
file. or to format the ¢ard.~,
Bad memory card detected during formatting.
Memory card root directory full. LECROY_I .DIR subdlrectory cannot be created.*
Memory card full when user attempted to write to It.*
The FUNCTION_RESET command resets a waveform processing
function. The number of sweeps will be reset to zero and the process restarted.
<function>:Function ReSeT
<function> := {MC~, MD~;, FE, FF}
Assuming that Function E (FE) has been defined as the summed
average of Channel 1, ;the following example will restart the averaging process.
CMD$=’FE:FRST’: CALL IBWRT(SCOPE%,CMD$)
DEFINE, INR?
¯ 1: 4-channel oscilloscopes only
"
~87
System Commands
I
I
FUNCTION
DESCRIPTION
COMMAND SYNTAX
FUNCTION_STATE, FSTA :[:
Command/Query
The FUNCTION_STATE command allows the user to control or
enquire how Functions C, D, E and F are being used. The four
waveform processing functions may assume up to three different
states:
MEMstatic memory of a waveform (no further automatic pro-
cessing occurs)
ZOOM
FUNC
The two Functions C and D may assume all three states whereas E
and F may assume only the states MEM and FUNC. The setup
information needed to execute expansions or mathematical wave-
form processing is memorized separately by the oscilloscope for
each function. When the state of a function is changed, the last
setup information associated with the new state will be reactivated.
There are three other commands which may cause a state transition. The command ZOOM applied to Functions C or D will
automatically switch them into zoom state. The commands
STORE (storage from internal waveform) and WAVEFORM
(storage from external waveform) applied to any one of the Func-
tions C, D, E or F will automatically switch them into the memory
state. There is never an automatic transition into the function
state. The command FUNCTION_STATE must be used.
Initially Functions C and D are set to the memory state and Func-
tions E and F are set to the function state.
The query FUNCTION STATE returns the current state of a
waveform processing function.
The following example switches the internal function memory C
into the mathematical waveform processing state thereby re-estab-
lishing the last valid waveform processing definition.
CMD$="MC:FSTA FUNC": CALL IBWRT(SCOPE%,CMD$)
DEFINE, STORE, WAVEFORM, ZOOM
89
System Commands
DISPLAY
DESCRIPTION
COMMAND SYNTAX
QUERY SYNTAX
GRID
Command/Query
The GRID command specifies whether the grid should be displayed in single, dual or quad~ mode.
In single grid mode all the traces are displayed on a single grid.
In dual grid mode the screen is split into two distinct grids to sepa-
rate the traces. In the dual-channel oscilloscopes, Channel 1 is
always displayed in the upper grid and Channel 2 in the lower grid.
In the 4-channel oscilloscopes, Channels 1 and 2 are always displayed in the upper grid and Channels 3 and 4 in the lower grid.
All other waveforms can be vertically positioned anywhere.
In quad grid mode~: Channel 1 is always displayed in the upper
grid, Channel 2 in the second grid, etc. All other waveforms can
be vertically positioned anywhere.
The GRID? query returns the grid mode currently in use.
GRID <grid>
<grid> := {SINGLE, DUAL, QUAD~;}
GRID?
Response Format
EXAMPLE (GPIB)
4-channel oscilloscopes only
90
GRID <grid>
The following command sets the screen display to dual grid mode.
CMD$=’GRID DUAL": CALL IBWRT(SCOPE%,CMD$)
System Commands 5
HARD COPY
DESCRIPTION
HARDCOPY_SETUP, HCSU
Command/Query
The HARDCOPY SETUP command configures the instrument’s
hard copy driver.-The command enables the user to specify the
device type, transmission mode, plot size etc. of the hard-copy
unit connected to the oscilloscope.
The command allows one or more individual settings to be
changed by specifying the appropriate keyword(s) together with
the new value(s). For instance, to select the Graphtec FP5301
plotter with normal speed, the command may be restricted to:
The HARDCOPY_TRANSMIT command sends a string of ASCII
characters without modification to the hard-copy unit. This allows
the user to control the hard-copy unit by sending device specific
control character sequences. It also allows the user to place addi-
tional text on a screen dump for documentation purposes. This
command accepts the escape sequence "\ddd" like those de-
scribed under the command COMM_RS232 (see page 56).
Before sending the string to the hard-copy unit the escape sequence is converted to the ASCII character code.
HardCopy_TRansmit ’<string>’
<string> := Any sequence of ASCII or escaped characters.
The following code sends documentation data to a printer.
CMD$="HCTR ’Data from Oct.15\r\n’"
CALL IBWRT(SCOPE%,CMD$)
The following code sends the same documentation data to an
HP7470A plotter using pen 1. The text will be printed at the lower
left corner of the paper.
CMD$=
"HCTR ’IN;SP1;PA0,0;PD;LBData from Oct.15 \031N;SP0;PA0,0’"
CALL IBWRT(SCOPE%,CMD$)
RELATED COMMANDS
HARDCOPY_SETUP, SCREEN_DUMP
93
System Commands
|
|
DISPLAY
DESCRIPTION
COMMAND SYNTAX
HOR_MAGNIFY, HMAG
Command/Query
The HOR_MAGNIFY command horizontally expands the selected expansion trace by a specified factor. Magnification factors
which are not within the range of permissible values will be
rounded to the closest legal value.
If multiple zoom is enabled, the magnification factor for all expansion traces is set to the specified factor. If the specified factor is too
large for any of the expanded traces (depending on their current
source), it is reduced to an acceptable value and only then applied
to the traces.
The VAB bit (bit 2) in the STB register (Table 8, page 137 ) is
if a factor outside the legal range is specified.
The HOR MAGNIFY query returns the current magnification
factor for t’he specified expansion function.