LeCroy, ProBus and SMART Trigger are registered trademarks, and ActiveDSO, ScopeExplorer, WaveAnalyzer and
Waverunner are trademarks, of LeCroy Corporation. Centronics is a registered trademark of Data Computer Corp. Epson
is a registered trademark of Epson America Inc. Mathcad is a registered trademark of MATHSOFT Inc. MATLAB is a
registered trademark of The MathWorks, Inc. Microsoft, MS and Microsoft Access are registered trademarks, and Windows
and NT trademarks, of Microsoft Corporation. PowerPC is a registered trademark of IBM Microelectronics. DeskJet,
ThinkJet, QuietJet, LaserJet, PaintJet, HP 7470 and HP 7550 are registered trademarks of Hewlett-Packard Company.
Manufactured under an ISO 9000
Registered Quality Management System
www.lecroy.com to view the
Visit
certificate.
LTXXX-RCM-E Rev B
This electronic product is subject to
disposal and recycling regulations
that vary by country and region.
Many countries prohibit the
disposal of waste electronic
equipment in standard waste
receptacles.
For more information about proper
disposal and recycling of your
LeCroy product, please visit
www.lecroy.com/recycle.
PROGRAM MESSAGES........................................................................................................................................6
COMMANDS AND QUE RIES............................................................................................................................7
HE ADERS .................................................................................................................................................................8
HE ADER PATHS.....................................................................................................................................................8
CHARACTE R DATA ..............................................................................................................................................9
NUMERIC DATA ....................................................................................................................................................9
BLOCK DATA ........................................................................................................................................................10
ADDRE SS ................................................................................................................................................................14
INTERFACE CL E AR ............................................................................................................................................16
CONFIGURE THE GPIB-DRIVE R SOFTW ARE .......................................................................................16
MAKE SIMPL E TRANSFERS............................................................................................................................17
USE ADDITIONAL DRIVER CALLS.............................................................................................................19
MAKE SERVICE REQUESTS ...........................................................................................................................19
Tak eInstrum ent Po lls ....................................................................................................................21
DO CONTINUOUS POL LING ........................................................................................................................21
TAK E A SERIAL POLL .......................................................................................................................................21
DO A PARAL L EL POLL .....................................................................................................................................22
PERFORM AN *IST POLL .............................................................................................................................. 24
Drive Hard-copy Devi c es o nth eGPIB ..........................................................................................25
READ DATA BY CONTROLLER .................................................................................................................... 25
SEND DATA TO BOTH ..................................................................................................................................... 25
TAL K DIRECTLY TO PRINTE R.....................................................................................................................26
CHAPTER THREE:
Communicat ethroughthe RS-232-C Port .....................................................................................29
HANDSHAKE CONTROL ................................................................................................................................29
EDITING FE ATURES.........................................................................................................................................30
MESSAGE TERMIN ATORS..............................................................................................................................30
LONG LINE SPL ITTIN G .................................................................................................................................. 31
LOGICAL DATA BLOCKS ................................................................................................................................ 35
INSPECT WA VEFORM CONTENTS ............................................................................................................. 36
USE THE W A VE FORM QUERY ......................................................................................................................37
INTERPRET VERTICAL DATA ......................................................................................................................39
CALCUL ATE A DATA POINT’S HORIZONTAL POSITION ............................................................... 40
USE THE W A VE FORM COMMAND .............................................................................................................42
Tra nsfer Waveforms at HighSpeed................................................................................................4 3
CH APTER FI VE:
Use Status Register s.......................................................................................................................45
OVE RVIEW ............................................................................................................................................................45
STATUS BYTE REGISTER (STB)....................................................................................................................47
STANDARD EVENT STATUS RE GISTE R (ESR) ...................................................................................... 47
STANDARD EVENT STATUS ENABLE REGISTE R (ESE )................................................................... 48
SERVICE REQUEST ENABL E RE GISTER (SRE )..................................................................................... 48
PARALLEL POLL ENABLE RE GISTE R (PRE) .......................................................................................... 48
INTERNAL STATE CHANGE STATUS REGISTE R (INR).....................................................................48
INTERNAL STATE CHANGE ENABL E REGISTER (INE ) ..................................................................49
COMMAND E RROR STATUS RE GISTE R (CMR)..................................................................................... 49
DEVICE DEPENDEN T ERROR STATUS RE GISTE R (DDR).............................................................. 49
EXECUTION E RROR STATUS REGISTER (EXR)................................................................................... 49
USER REQUEST STATUS REGISTER (URR).............................................................................................49
This manual explains how to remotely control the oscilloscope, using commands keyed into the external
controller. This controller will normally be a computer, although it could be a simple terminal.
The manual includes a complete list of the commands you’ll need to perform most Wave runner operations
(you can find commands for a few special, optional functions in the software option’s dedicated manual). The
manual has two main parts:
Part One, “A bout R emote C ont r ol,” covers the principles of remote control, and offers practical
examples.
Part Two, “C ommands ,” describes each of the remote control commands and queries for Waverunner
operations. It starts w ith two special indexes that list the commands by short name and by category. Use these
to find the command or query you wish to use.
See also the table of contents and the index at the back of the manual.
As an additional guide, each chapter is prefaced by a summary of its contents.
Wa tch for these icons and the information they signal:
s offer additional hints on how to get the most out of Waverunner actions or features.
TTIIPPs
s bring to your attention important information you should know.
NNOOTTEEs
See also Chapter 12, “U se Waver unner wit h PC,” in the Operator’s M anual.
LTXXX-RCM-E RevBISSUED: January 20021
BLANK PAGE
2ISSUED: January 2002L TXXX-RCM-E Rev B
A
A
P
P
B
B
T
AARRT
O
O
O
O
U
NNE
U
E
T
T
R
Part One of the manual explains how Waverunner operates under remote control. I t covers GPIB and
RS-232-C interfaces, the transfer and formatting of waveforms, and the use of status bytes in reporting
errors.
R
E
E
M
M
O
O
T
T
E
E
C
C
O
O
N
N
T
T
R
R
OLL
O
LTXXX-RCM-E RevBISSUED: January 20023
C HAPTER O NE:
In thi s chap te r, see how
To con stru ct pr o gr ammessages
To use comm an ds and queries
To include data, and mak e data strin gs
TouseScopeExplorer for remote control
Over view
4ISSUED: January 2002L TXXX-RCM-E Rev B
C HAPTERO NE
Over v iew
Oper ate W aver unn erbyRemo te Con tr ol
Yo ucan fully control you r Waverunner oscilloscop eremote lyby using either the GPIB (General Purpose
Interface Bus) port or the RS-232-C comm u nic a tion port on the scope rea r pan el, shown belo w. Theonly
actions for which you must use the front panel controls are the powe ring up of the scope and the setting of
remote addresses. Use L eCroy’s ScopeE xplorer software as the ideal interface between scope and PC (see page
11).
RS-232-C Port
Centronics Port
PowerInputBN C Signal Output
External MonitorPort
PC CardSlot
(Memory/ Hard-Disk card )
GPIB Port
Waverunner back panel , including t he G P I B and R S -232-C ports us ed in remot e cont rol .
: Use Waverunner Remote Control Assistant to monitor all your remote control operations. See the
TTIIPP:
COMM_HELP
command in Part Two of this manual, and Chapter 12 of the
Operator ’s Manual
,“Use
Waverunner with PC”.
LT3XX-RCM-E RevBISSUED: January 20025
P ART O NE: ABOUT REMOTE CONTROL
STANDARDS
*
LeCroy remote control commands conform to the GPIB IE E E 488.2
ex ten sionof the IEEE 488.1 standa rd, whic h dea ls mainly with ele ctrical andmech a n ical issue s. The IEEE
488.2 recommendations ha v ealso be e nadopted for RS-232-C comm un ications wh erever appropriate .
PROGRAM MESSAGES
Yo ucontrol the oscilloscop eremotelyusingprogrammessa g es that consist of one or sev eral commands or
qu e rie s . The program messa g e s yousend from the ex ternal controller to the W a v erunne r oscilloscop emu st
conform to precise format structures. The oscilloscope will execute all program messages sent in the correct
form, but will igno re those with errors.
You can use upper- or lowe r-case characters, or both, in program messages.
W a rningor error messag es are normally not reported unle ss the controller ex p licitlyexa m ine sthe rele v a n t status
register, or if the status-enable registers have been set so that the controller can be interrupted w hen an error
occurs. If you connect an external monitor to the W averunner’s RS-232-C port, how ever, yo uw ill be able to
observe all your remote control transactions, including error messages, as they happen. See the command
COMM_HELP in Part Two, “Commands.”
Program messages are separated by semicolons ; and end in a terminator:
The oscilloscop ew ill not decod ean incomingprogram messag ebefore rece i vingits terminator. The exception is
w h e nthe program mes sa g eis longe r thanthe 256 by te input buffer; thenthe oscilloscop ew ill start ana ly zingthe
message whe n the buffer is full. Commands and queries are executed in the order in w hich they are transmitted.
standard. This may be considered an
In GPIB mode, the follow ingare valid terminators:
<NL >New-line character (i.e. the ASCII new-line character, w hose decimal value is 10).
<NL >< EOI>New-line character with a simultaneous < EOI> signal.
<EOI> < E OI>Signal together w ith the last character of the program message.
The <NL > <EOI> terminator is always use d in resp on semes sa g e s sent by the oscilloscope to the controller.
In RS-232-C commu n ic a tions , you can de fine the terminator with the comman dCOMM_RS232. The default
value is <CR>, which is the ASCII carriage return charac ter, who sede cimal valu eis 13.
NNOOTTEE:
: T he < E OI> signal is a dedicated GPI B interface line, which can
be set witha special call to the GPIB inter face driv er. Referto theGPIB
in ter f ace manufacturer’s manual and supp o r t pr o gr am s .
*ANSI/IEE E Std. 488.2–1987, IE EE Standard Codes, Formats, Protocols, and Common Commands. The Institute of Electrical and Electronics E nginee rs
Inc., 345 E ast 47th Street, New York, NY 10017 USA.
6ISSUED: January 2002LTXXX-RCM-E RevB
C HAPTER O NE:
COMMAND S AND QUERIES
Program messages are made up of one or more commands or queries. While the command directs the
oscillosco p eto chang eits state (for ex a m p le, its timeba seor vertical sensitivity) the query ask s the oscillosc op e
about that state. Very often, you will use the same mnemonic for a command and a query , the query being
identified by a ? after the last character.
For ex a m p le, to chang ethe timeba seto 2 ms/div , send this comma n d to the oscilloscop e:
TIME_DIV 2 M
Or, to ask the oscilloscop eabo u t its timeb a se, send this query:
TIME_DIV?
A query causes the oscilloscop eto sen d a respon semess a g e. The control programshouldread this messa g ew ith
a ‘read’ instruction to the GPIB or RS-232-C interface of the controller.
Theresponsemessagetotheabovequerymightbe:
TIME_DIV 10 NS
The portion of the query preceding the question mark is repeated as part of the response message. If desired,
this text can besuppressed withthecommand COMM_HEADER.
Depending on the state of the oscilloscope and the computation to be done, several seconds may pass before a
response is received. Command interpretation does not have priority over other oscilloscope activities.
The general form of a command or a query consists of a command header, < header> , optionally followed by
one or several parameters, < data> , separated by commas:
Overview
<header>[?] < data>,...,< data>
The notation [?] shows that the question mark is optional (turning the command into a query).
There is a space between the header and the first parameter.
There are commas between parameters.
The following are examples of how program
messages are made up of commands and queries...
GRID DUAL: This program message consists of a
sing lecomma n d that instructs the oscilloscope to
display a dual grid.
The terminator is not show n , as it is usu ally automaticallyadd ed by the interfacedriver routine writing to GPIB
or RS232.
DZOM ON; DISPLAY OFF; DATE?:This program message consists of tw o commands, followed by a
query . They instruct the oscilloscope to turn on the multi-zoom mode, turn off the display , and then ask for the
current date. Again, the terminator is not shown.
DATE 15,JAN,1993,13,21,16: This command instructs the oscilloscope to set its date and time to 15
JAN 1993, 13:21:16. The comma n dhea d e r DATE indicates the action, the 6 data values specify it in detail.
LT3XX-RCM-E RevBISSUED: January 20027
: Set the controller I/ O timeout conditions
TTIIPP:
to thr e eormore seconds to giv ethescop etime
to respo n d. An incorr ect query will not get a
re sp o nse; and, if Remo te Con trol Assistant is
ena bled, a beep will sound.
P ART O NE: ABOUT REMOTE CONTROL
HEADERS
The hea d e r is the mnemon ic form of the operation to be pe rformed by the oscilloscope. Most comma ndand
query headers have a long form, which allows them to be read more easily, and a short form for better transfer
and decoding spee d. The two are fully equivalent and you can use them interchangeably. For example,
TRIG_MODE AUTO and TRMD AUTO are two separate but equivalent commands for switching to the
automatic trigger mode.
Some comman dor qu e ry mnemo nic s are impose dby the IEEE 488.2 standard. Theyare stand a rdize dso that
differen t oscilloscop es w ill presen t the same programminginterfacefor similar functions.All thesemnemo n ics
beginwithanasterisk* . For example, the command *RST is the IEEE 488.2 impose dmnem on ic for rese tting
the oscilloscope, whe reas *TST? instructs the oscilloscop eto perform an internal self-test andreport the
outcome.
HEADERPATHS
Certain commands or queries apply to a sub-section of the oscilloscope; for example, a single input channel or a
trace on the display . In such cases, you must prefix the heade r by a path name that indicates the channel or trace
to which the command applies. The header path normally consists of a two-letter path name followed by a
colon : immediately preceding the command heade r. One of the wave form traces can usually be specified in the
header path:
HEADER PAT H N AM EWAV E FOR M T RACE
C1, C2
C3, C4
M1, M2, M3, M4
TA, TB, TC, TD
EX, EX10, EX5
LINE
Example: C1:OFST -300 MVCommand to set the offset of Channel 1 to −300 mV.
You need only specify a header path once. Subsequent commands with header destinations not indicated are
assumed to refer to the last defined path. For example, the queries C2:VDIV?; C2:OFST? ask: What is the
vertical sensitivity and the offset of channel 2? While the queries C2:VDIV?; OFST? ask exactly the same
qu e stion without repe a tingthe path.
Channels 1 and 2
Channels 3 and 4 (on four-channel models)
Memories 1, 2, and3 an d4
Trac es A, B, C an dD
External trigger
LINE sourcefor trigger
8ISSUED: January 2002LTXXX-RCM-E RevB
C HAPTER O NE:
DATA
Whenever a command or query uses additional data values, the values are expressed as ASCII characters. There
is a single exception: the transfer of wave forms with the command/query WAVEFORM, where the wa veform can
be expressed as a sequence of binary data values. See Chapter 4, “Wavef or m St r uct ur e.” ASCII data can
have the form of character, numeric, string, or block data.
CHARACTER DATA
Thesearesimplewordsor abbreviationsto indicate a specific action.
Example: DUAL_ZOOM ON
In this example, the data value ON commands the dual zoom mode to be turned on (the data value OFF will
havetheoppositeeffect).
How eve r, this can become more complex. In some commands, where you can specify as many as a dozen
different parameters, or wherenot all theparametersareapplica ble at thesametim e, theformat re quires pairs of
data values . The first value names the parameter to be modified, while the second gives its value. Only those
parameter pairs changed need to be indicated.
Example: HARDCOPY_SETUP DEV,EPSON,PORT,GPIB
In this example, two pairs of parameters have been used. The first specifies the device as an EPSON (or
compatible) printer, w hile the second indicates the GPIB port. While the command HARDCOPY_SETUP allow s
many more parameters, either they are not relevant for printers or they are left unchanged.
Overview
NUMERIC DATA
The numeric data type is used to enter quantitative information. Numbers can be entered as integers or
fractions,or in exponential representation:
TA:VPOS -5Move the displaye d trace of Trace A downw ards by five divisions.
C2:OFST 3.56Set the DC offset of Channel 2 to 3.56 V.
TDIV 5.0E-6Adjust thetimebaseto5µsec/div.
Example: There are many way s of setting the timebase of the oscilloscope to 5 µsec/div:
TDIV 5E-6Exponential notation, without any suffix.
TDIV 5 USSuffixmultiplierU for 1E −6, with the(optional) suffixS for seconds.
or
TDIV 5000 NS
TDIV 5000E-3 US
Yo ucan follow nume ric value s with multiplie rs and units, to modify the valu eof the nu merical ex p re ssio n.The
following mnemonics are recognized:
LT3XX-RCM-E RevBISSUED: January 20029
P ART O NE: ABOUT REMOTE CONTROL
MULTIPLIERE XP .NOT E.SUFFIXMULTIPLIERE XP.NOTE .SUFFIX
EX1E18Exa-PE1E15PetaT1E12Tera-G1E9GigaMA1E6Mega-K1E3k iloM
N
F
STRIN G DATA
Thisdata type enables youto transfera (long) stringof characters asasingleparameter. Simplyenclose any
sequence of ASCII characters betwee n single or double quotation marks:
MESSAGE ‘Connect probe to point J3’
The oscilloscope displays this message in the Message field above the grid.
BLOCK DATA
These are binary data values coded in hexade cimal ASCII: four-bit nibbles translated into the digits 0 through 9
or A through F, and transmitted as ASCII characters. They are used only for the transfer of wa veforms from
Wa verunner to controller (WAVEFORM) and for Wa verunner panel setups (PANEL_SETUP)
RESPONSE MESSAGES
The oscilloscope sends a response message to the controller in answ er to a query . The format of such messages
is the same as that of program messages: individual responses in the format of commands, separated by
semicolon s ; and ending in terminators. These messages can be sent back to the oscilloscope in the form in
which they were received, to be accepted as valid commands. In GPIB response messages, the < NL > < E OI>
terminator is alwa ys used.
1E−3
1E−9
1E−15
milli-U
nano-PI
femto-A
1E−6
1E−12
1E−18
micropicoatto-
Example: The controller sends the program message:
TIME_DIV?;TRIG_MODE NORM;C1:COUPLING? (terminator not shown).
The oscilloscope might respond to this with:
TIME_DIV 50 NS;C1:COUPLING D50 (terminator not shown) .
The response message refers only to the queries: TRIG_MODE is left out. If this responseis sent backto the
oscillosco p e, it is a valid program messa g efor setting its timebase to 50 ns/div and the inp u t couplin gof
Channel 1 to 50 Ω.
Whenever you expect a response from the oscilloscope, you must have the control program instruct the GPIB
or RS-232-C interface to rea dfrom the oscilloscop e. If the controller sends another program message without
reading the response to the previous one, the response message in the output buffer of the oscilloscope will be
10ISSUED: January2002LTXXX-RCM-E Rev B
C HAPTER O NE:
disca rde d . The oscilloscope kee ps to stricter rules for resp on seme ssa g e sthan for acc e p tan ceof program
messages. While you can send program messages from the controller in upper- or lower-case characters,
response messages are always returned in upper-case. Program messages may contain extraneous spaces or tabs
(white space), but response messages will not. And while program messages may contain a mixture of short and
long command or query heade rs, response messages alwa ys use short headers by default.
How eve r, you can use the command COMM_HEADER to force the oscilloscopeto uselong hea ders, or noneat
all. If the response header is omitted, the response transfer time will be minimized. But the response will not be
ableto be sent back to the oscilloscope. Suffix units are also supp resse d in the response .
If you were to set the trigger slope of Channel 1 to negative, the query C1:TRSL? mig ht yie ld the following
response s:
Overview
C1:TRIG_SLOPE NEGhea der format: long
C1:TRSL NEGhea der format: short
NEG
header format: off
: Wav efo r m s you obtain fromthe
TTIIPP:
oscilloscope using the query
WAVEFORM?
a special kind of response message. Control
theirex act for m at by using the
COMM_FORMAT
an d
COMM_ORDER
are
commands.
USE SCOPEEXPLORER
ScopeExplorer is an easy-to-use and practical software tool for interfacing your W ave runner oscilloscope with a
PC running Windows:
1.Connect the scope to a PC using either the GPIB (you’ll need a PC with GPIB card installed) or PCstandard RS-232-C port on the scope ’s rea r pan el.
2.DownloadScopeExplo rer free of ch argeat http:/ / www.lecroy .com/ scopeexplorer. Or inquire at your
LeCroy customer service center.
3.Having installed ScopeExplorer, open it as you would any Windows program. Use its on-line help to do the
follow in g :
Use the teletype-like terminal to send standard remote control commands from computer to
oscillosco p e, an dto displa ythe W a v erunne r respon seon the PC.
Control the scope by means of an interactive, virtual scope front panel.
Pipe sequences of commands from a file to the scope, then send the scope’s responses to another file.
Transfer pixel-for-pixel copies of your Wa verunner display to PC, then view them, print them, or both
from the computer. With a single press of a button or key , you can copy bitmap wave form images to
the Windows Clipboard, ready to paste into any Windows application.
Capture Wa verunner front panel setups and, using a long filename, store them on the computer. You
can then transfer them back into the scope to reproduce an identical setup.
Transfer your waveforms to PC, and store them in either the compact L eCroy Binary format, or an
ASCII version compatible with PC-based analysis products.
LT3XX-RCM-E RevBISSUED: January 200211
C HAPTER T WO:
In thi s chap te r, see how
To address yo urWav er un n erscope forGPIB
Toconfi gureGPIB softwa re
To enable remote or local control
To mak e transfer s of data
To makeservice reque sts
To poll Waverunner
To driv e har dcopy devices
ControlbyGPIB
12ISSUED: January2002LTXXX-RCM-E Rev B
C HAPTERT WO
ControlbyGPIB
Talk, L isten, or Control
Yo ucan remotelycontrol you r W a v e runn e r oscilloscope, usingthe Gene ra l PurposeInterfaceBus (GPIB).
GPIB is similar to a standard computer bus. But while the computer interconnects circuit cards by means of a
bac k plane bus, the GPIB interconn e cts inde p endent devices (os cillos copes and compute rs, for ex a m p le) by
means of a cable bus. GPIB also carries both program and interface messages.
Progr ammessages, often called device dependent messages, contain programming instructions, measurement
results,and oscilloscopestatus and wa v eform data.
Interface messages manage the bus itself. They perform functions such as initialization, addressing and
“unaddressing” of devices, and the setting of remote and local modes.
TALK, LIST EN, OR CONTROL
On the one hand, devices connected by GPIB to your Wa verunner oscilloscope can be listeners, talkers, or
controllers. A talker sends program messages to one or more listeners, w hile a controller manages the flow of
information on the bus by sending interface messages to the devices. The host computer must be able to play
all three roles. For details of how the controller configures the GPIB for specific functions, refer to the GPIB
interface manufacturer’s manual.
On the other hand, the Waverunner can be a talker or listener, but
IN T ERFACE
W averunne r interface cap abilities includethe following IEEE 488.1 de finitions:
AH1Complete Acceptor HandshakeDC1CompleteDeviceClearFunction
SH1Complete Source HandshakeDT1Comp lete DeviceTrigger
L4Partial Listener FunctionPP1Parallel Polling : remo te configurable
T5Comp le te Talke r FunctionC0No Controller Functions
SR1Comp le te Service Reque s t FunctionE2Tri-stateDrive rs
RL1Complete R emote/Local Function
LTXXX-RCM-E RevBISSUED: January 200213
NOT a controller.
P ART O NE: ABOUT REMOTE CONTROL
ADDRE SS
Every device on the GPIB has an address. To address Wa verunner, set the remote control port to GPIB by
means of thescope ’s front pane l UTILITIES button and on-scree nmen u s .If yo usele ct “RS-232” in the same
way, the oscilloscop ew ill execute over the GPIB solely“talk-only ” operations,such as driving a printer. Setting
W averunne r to “RS-232” enab le sthe oscilloscop eto becontrolled throughtheRS-232-C port. See Chapter 12
of the Operator’s M anual for how to do this.
If youaddre ss Wa v e runn e r to talk, it will rema in in that state until it receives a uni versal untalk comma n d
(UNT), its ow n listen address (ML A), or ano ther oscillosco p e’s talk addres s .
If youaddre ss Wa v e runn er to listen, it w ill rema inconfiguredto listen until a univ e rsa l unlisten comma n d
(UNL ), or its own talker address (MTA), is received.
GPIB SIGNAL S
The GPIB bus systemconsists of 16 signal lines and eigh t ground or shieldlines .The signa l lines are divided
into three groups:
Data Lines:Theseeig h t lines , usua llycalle d DI01 throughDI08, carry both prog ramand interface messag es.
Most of the messages use the 7-bit ASCII code, in which case DI08 is unused.
Handshake Lines: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.
Inter face Management Lines: These 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
mes sa g es suchas talk and listen addresses or a deviceclea r (DCL ) messa g e. WhenATN is false, the bus is in
data mode for the transfer of program messages from talkers to listeners.
IFC (InterFaceClear):The controller sets the IFC line true to initialize the bus.
RE N (RemoteENable): The controller uses this line to place devices in remote or local program mode.
SRQ (ServiceReQues t ): AnydevicecandrivetheSRQlinetruetoasynchronouslyrequest servicefromthe
controller. This is the equivalent of a single interrupt line on a computer bus.
EOI(End Or Identify):This line has tw o 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 BUFFE RS
The oscilloscope has 256-byte input and output buffers. An incoming program message is not decoded before
a message terminator has been received. However, if the input buffer becomes full (because the program
mes sa g eis longe r than the buffer),the oscilloscop estarts analy z ingthe messa ge. In this casedata trans miss ion
is temp o rarilyhalted , and the controller maygen e ratea timeo u t if the limit was set too low.
14ISSUED: January2002LTXXX-RCM-E Rev B
C HAPTER T WO:
USE IE E E 488.1 STAN DARD M E SSAGE S
The IEEE 488.1 stand a rd specifies not onlythe mech a n ical andele ctrical asp ects of the GPIB, but also the
low-level transfer protocol. For instance, 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.
ControlbyGPIB
All these messages except GET are executed
immediately upon receipt.
The command list in Part Two of this manual does
not contain a command for clearing the input or
output buffers, nor for setting the oscilloscope to the
remote state.
This is because such commands are already specified as IEEE 488.1 standard messages. Refer to the GPIB
interface man u al of the host controller as w e ll as to its supp ort progra ms , whic h should contain spec ia l calls for
theexecutionof thesemessages.
The following description covers those IEEE 488.1 standard messages that go beyond mere reconfiguration of
the bus and that have an effect on Wave runner operation.
DEVICE CLEAR
In response to a universal Device CLear (DCL ) or a Selected Device Clear message (SDC), Wave runner clears
the input or output buffers, cancels the interpretation of the current command (if any) and clears pending
commands. However, statusregisters and status-enableregisters arenot cleared. Although DCL will have an
immediate effect, it can take several seconds to exe cute if the oscilloscopeis busy.
GROUP EXECUTE TRI GGER
The Group E xecute Trigger message (GET) causes Waverunner to arm the trigger system, and is functionally
ide ntica l to the *TRG command.
N OT E : In addition to the IE E E 488.1 interface
message standards, the IE E E 488.2 standard
specif ies certainstandar dized pr ogrammessages,
i.e., comm and h eader s. Theyare iden tified witha
leadin g asterisk * and are listed in the System
Commands section.
RE MOT E ENABL E
This interface message is executed when the controller holds the Remote ENable control line (RE N) true,
allowing you to configure the oscilloscope as a listener. All the front panel controls except the menu buttons
are disabled. The menu indications on the right-hand side of the screen no longer appea r, since menus cannot
now be operated manually . Instead, the text REMOTE E N ABL E appears at the top of the menu field to
indica te that the oscilloscop eis set in the remote mode . When e v er the controller returns the RE N line to false,
all oscillosco pes on the bus return to GO TO LOCAL.
When you press the GO TO LOCAL menu button, the scope returns to front panel control, unless you have
pla ced the oscillosco p ein Local LOckout (LLO) mode (seebelo w).
LTXXX-RCM-E RevBISSUED: January 200215
P ART O NE: ABOUT REMOTE CONTROL
The Go To Local message (GTL) causes the oscilloscopeto return to local mode . All front pa n e l controls
become active and the normal menus reappe ar. Thereafter, whene ver the oscilloscope is addressed as a listener
it will be immediately reset to the remote state, except when the LL O command has been sent.
When you activate Local Lockout the scope can only be returned to its local state by returning the L LO to
false.Whene v er youreturn the oscillosco p eto the remote state the local lockou t modewill immedia te ly
becom eeffective again.
The L ocal LOckout message (L L O) causes the GO TO LOCAL menu to disappear. You can send this message
in local or remote mode. But it only becomes effective once you have set the oscilloscope in remote mode.
INTERFACE CLEAR
The InterFace Clear message (IFC) initializes the GPIB but has no effect on the operation of the Wa verunner.
NNOOTTEE:
: To illu strate theGPIB progr amming concep ts a nu mberof examples writteninBASICA are
included here. It is assumed that the controller is IBM- PC compatible, running under DO S, and that
it is equipp ed with a N ational Instrumen ts GPIB interface card. Neverth eless, GPIB pro gram m in g
withotherlanguages such as C orPascal is quite similar . If yo u’re using ano th ertype of comp uteror
GPIB interface, refe rto the interface manual forinstallatio npr o ced ur es and subro utine calls.
CONF IGURE TH E GPIB DRIVER SOFTWARE
1.Verify that the GPIB interface is properly installe d in the computer . If it is not, followthe interface
man u facture r’s installation instructions. In the caseof the National Instruments interface , it is pos sibleto
modify the base I/ O address of the board, the DMA channel number, and the interrupt line setting using
switches and jumpers. In the program examples below, default positions are assumed.
2.Connect Wave runner to the computer with a GPIB interface cable.
3.Set the GPIB address to the required value. The program examples assume a setting of 4.
The host computer requires an interface driver that handles the transactions betwe en the operator’s programs
and the interface board.
In the caseof the National Instrume n ts interface , the installation proced u re will:
a.CopytheGPIB handler GPIB.COM into theboot director y.
b.Modify the DOS system configuration file CONFIG.SYS to declare the presence of the GPIB handler.
c.Crea te a sub-directory calle dGPIB-PC, and install in GPIB-PC a numb e r of files and programs useful for
testing and reconfiguring the system, and for writing user programs.
The following files in the sub-directory GPIB-PC are particularly useful:
IBIC.EXE allows interactive control of the GPIB by means of functions entered at the keyboard. Use of this
program is highly recommended to anyoneunfamiliar with GPIB programming or w ith Wave runner’s remote
commands.
16ISSUED: January2002LTXXX-RCM-E Rev B
C HAPTER T WO:
DE CL.BAS is a declaration file that contains code to be included at the beginning of any BASICA application
program.Simpleapplicationprograms can bequicklywritten byappendingtheoperator’s instructionsto
DECL.BAS andexecuting thecompletefile.
IBCONF.EXE is an interactive program that allows inspection or modification of the current settings of the
GPIB handler. To run IBCONF.EXE, refer to the National Instruments manual.
ControlbyGPIB
NNOOTTEE:
: I n the program examples in this section, it is assumed that the N ational Instruments GPIB
driv erGPIB.COM is in its default state, i.e., that the user has no t modified it with IBCONF.E XE .
T his means that the interface board can be referred to by the symbolic name ‘GPIB 0’ and that devices
onthe GPIB bus withaddresses between1and 1 6can be called by the sym bol ic names ‘DEV1 ’ to
‘DEV1 6 ’. If you h av ea NationalInstruments PC2 in ter f ace card r ath erth anPC2A, yo u must run
IBCONF to declare th epresen ceof thi s card ratherthanthe defau l t PC2A.
MAKE SIMPLE TRANSFERS
For a large number of remote control operations it is sufficient to use just three different subroutines
(IBFIND, IBRD and IBWRT) provide d by National Instrume n ts. The following complete program rea d s the
timebase setting of Waverunner and displays it on the terminal:
Lines 1–99 are a copy of the file DECL .BAS supplied by N ational Instruments. The first six lines are required
for the initialization of the GPIB handler. The other lines are declarations w hich 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 DE CL .BAS as arrays of 255 characters.
Lines 100 and 110 openthe deviceDEV4 and associatewith it thedescriptor SCOPE%. All I/O calls after that
w ill refer to SCOPE%. The default configuration of the GPIB handler recognizes DEV4 andassocia tes with it a
device with the GPIB address 4.
Lines 120 and 130 prepare the command string TDIV? and transfer it to the oscilloscope. The command
instructs the oscilloscope to respond with the current setting of the timebase.
LTXXX-RCM-E RevBISSUED: January 200217
P ART O NE: ABOUT REMOTE CONTROL
Lines 140 and 150 read the response of the oscilloscope and place it into the character string RD$.
Line 170 displays the response on the terminal.
NOTE: DECL.BAS requ ires acce ss to the file BIB.M du ring the GPIB initializa tion. BIB.M
is one of the files supplied by N ational Instruments, and it must exist in the directory
currently in use.
Thefirst two linesof DE CL.BAS both contain astring XXXXX, whichmustbe replaced bythenumber of
bytes that determinethemaximum workspace for BASICA (computed bysubtracting thesizeof BIB.M from
the spa cecurrently availa b lein BASICA). For ex a m p le, if the size of BIB.M is 1200 bytes , and whe nBASICA
is loaded it repo rts “60200 bytes free,” you should rep la ce“XXXXX” bythe value 59 000 orless.
When running this sample program, Wa verunner w ill automatically be set to the remote state w hen IBWRT is
exe cuted, and will remain in that state. Pressing the LOCAL menu button will return Wa verunner to local mode
if the GPIB handler was modified to inhibit L ocal LOckout (LL O). Here is a slightly modified version of the
sample program that checks if any error occurred during GPIB operation:
TheGPIB statuswordISTA%, 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 National Instruments manual
for details. The sample program above w ould report if the GPIB address of the oscilloscope was set to a value
other then 4. L ine 180 resets the oscilloscope to local with a call to the GPIB routine IBLOC.
18ISSUED: January2002LTXXX-RCM-E Rev B
C HAPTER T WO:
USE ADDIT I ONAL DRIVER CALLS
IBLOC is used to execute the IE EE 488.1 standard message Go To L ocal (GTL), i.e. it returns the
oscillosc op eto the loca l state. The programmin gexample aboveillustrates its use.
IBCLR executes the IE EE 488.1 standa rd messa g eSelectedDeviceClear (SDC).
IBRDF and IBWRTF, respe ctively , allowdata to be read from GPIB to a file, and w ritten from a file to
GPIB. Transferring data directly to or from a storage device does not limit the size of the data block, but
may be slow e r than transferring to the computer memory .
IBRDI andIBWRTI allowdatatobereadfromGPIBtoanintegerarray,andwrittenfromintegerarray
to GPIB. Since the integer arrayallows storageof up to 64 kiloby tes (in BASIC), IBRDI and IBWRTI
should be used for the transfer of large data blocks to the computer memory , rather than IBRD or
IBWRT, w h ichare limited to 256 by tes by the BASIC string length. Note that IBRDI andIBWRTI only
exist for BASIC, since for more modern programming languag es, such as C, the functions called IBRD
andIBWRT are far less limited in da ta blocksize .
IBTM O can be used to change the timeout value during program execution. The default value of the
GPIB driver is 10 seconds — for example, if the oscilloscop edoe s not respo n d to an IBRD call, IBRD
will return with an error after the specified time.
IBTRG executes the IEEE 488.1 stand a rd messa g eGroup Exe cu te Trigge r (GE T), wh ichcaus e s
Waverunner toarm the trigger system.
National Instruments supply a number of additional function calls. In particular, it is possible to use the socalle dboard leve l calls , wh ichallowa very detaile dcontrol of the GPIB.
ControlbyGPIB
NOTE: Th eSRQ bit is latch e dunti lthe con troll e rread s the STatus Byte Register(STB). Th eaction
of reading the ST B with the command
*STB?
clears the r egiste rcon te nts ex cept th eMAV bit (bit 4)
until a n eweven t occurs. Service requesting can be disabled by clearin g the SRE register
w i ththe
MAKE SERVICE REQUESTS
When a W ave runner is used in a remote application, events often occur asynchronously, i.e., at times that are
unpredictab lefor the host computer.The most common ex a m p leof this is a trigge r w a it after the oscilloscop e
is armed: the controller must wait until the acquisition is finished before it can read the acquired wa veform.
The simplest way of checking if a certain event has occurred is by either continuously or periodically reading
the status bit associa te d with it until the required transition is detected. Continuous status bit pollingis
described in more detail below. For a complete explanation of status bits refer to Chapter 5.
Perhaps a more efficient wa y of detecting events occurring in the oscilloscope is the use of the Service Reque st
(SRQ). This GPIB interrupt line can be use dto interrupt program ex ecution in the controller. The controller
can thenex e c u te other program s w h ilew a iting for the oscilloscope. Unfortuna te ly, not all interface
manufacturers support theprogrammingof interrupt service routines. In par ticular, NationalInstruments
supports only the SRQ bit within the ISTA% status word. This requires you to continuously or periodically
LTXXX-RCM-E RevBISSUED: January 200219
*SRE 0 command.
P ART O NE: ABOUT REMOTE CONTROL
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 pow er-on, the Service ReQuest is disabled. You enable SRQ by setting the Service
Request E nable register with the command “*SRE ” and by specifying which event should generate an SRQ.
Wa verunner will interrupt the controller as soon as the selected event(s) occur by asserting the SRQ interface
line. If several devices are connected to the GPIB, you may be required to identify which oscilloscope cause d
the interrupt by serial pollingthe various device s .
Example:To assert SRQ in response to the events “new signal acquired” or “return-to-local” (pressing the
soft key/ menu button for GO TO L OCAL).T hese events are tracked by the INR register, which is ref lected in
the SRE register as the INB summary bit in position 0. Since bit position 0 has the value 1, the command
*SRE 1 enables the generation of SRQ whe never the IN B summary bit is set.
In addition, the events of the INR register that may be summarized in the INB bit must be specified. The
event “new signal acquired” corresponds to INE bit 0 (value 1) while the event “return-to-local” is assigned to
INE bit 2 (value 4). The total sum is 1 + 4 = 5. Thus the command INE 5 is needed:
CMD$=“INE 5;*SRE 1”
CALL IBWRT(SCOPE%,CMD$)
Example:To assert SRQ whe n soft key4 (fourth menu button from top of screen) is pressed. The event “soft
key4 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 E SE 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 generated 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$)
NNOOTTEE:
: The term “soft-key,” used her e in refer en ce to r em ote oper ation s, is syno n y m o us with “men u
button ,” used in the accom p anyin g Oper ato r’s Manual to meanfront panel operation s. Both term s
refer to the column of seven buttons running parallel to the screen on the Waverunner front panel and
th emenu fun ctions th e ycontro l .
20ISSUED: January 2002L TXXX-RCM-E Rev B
C HAPTER T WO:
ControlbyGPIB
Take Instrumen t Polls
Youcan regularlymonitor state transitions withintheoscilloscopebypolling selected internal status registers.
Thereare four ba sic pollingmethods you can useto detec t the occurrence of a giv e nevent: continuou s , serial,
pa rallel, an d *IST. By far the simplest of these is continuous polling. The others are appropriate only when
interrupt-service routines (servicing the SRQ line) are supported, or multiple devices on GPIB require constant
monitoring. To emphasize the differences betwe en the methods, described below, the same example
(determining whether a new acquisition has taken place) is used in each case.
DO CONT IN UOUSPOLLIN G
A status register is continuouslymonitoreduntil a transition isobserved. This isthemost straightforward
method for detecting state changes , but may not be practical in certain situations, especially with multiple
device configurations.
In the followin gexample,the even t “newsigna l acqu ired ” is obse rved by continuouslypollin gthe INternal
state change Register (INR) until the corresponding bit (in this case bit 0, i.e., value 1) is non-zero, indicating a
new wavefor m has been acquired. Reading IN R clears this 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
oscillosco p eto omit anycomma ndhea d e rs whe nresponding to a query , simplifying the decoding of the
resp on se. The oscilloscop ew ill then sen d “1” instead of “INR 1”:
CMD$=“CHDR OFF”
CALL IBWRT(SCOPE%,CMD$)
MASK% = 1‘New Signal Bit has value 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
TAKE A SER IAL POLL
Serial pollin gtak es pla ceoncethe SRQ interrupt line has beenasse rted, and is only adv a n tag e o u s whe nyouare
usingsev e ra l oscilloscope s at once. Thecontroller finds wh ichoscilloscop ehas gene rate d the interrup t by
inspecting the SRQ bit in the STB register of each. Because the service request is based on an interrupt
LTXXX-RCM-E RevBISSUED: January 200221
P ART O NE: ABOUT REMOTE CONTROL
mec h a n ism , seria l pollin goffers a reas on a b lecomp romisein terms of servicing spee din multiple -de vice
configurations.
In thefollowingexample, thecommandINE 1 enables the event “new signal acquired” to be reported in the
INR to theINB bit of thestatus byteSTB.Thecommand*SRE 1 enables the INB of the status byte to
generate an SRQ wheneve r it is set. The function call IBWAIT instructs the computer to wa it until one of
three conditions occurs: &H8000 in the mas k(MASK%) correspond s to a GPIB error, &H4000 to a timeou t
error, and &H0800 to the detection of RQS (ReQue s t for Service) generated by the SRQ bit.
Whe never IBWAIT detects RQS it automa ticallype rforms a serial poll to find out w h ic h oscilloscop egen e ra ted
the interrupt. It w ill onlyexit if there w as a timeou t or if the oscillosco p e(SCOPE%) generated SRQ. The
additional function call IBRSP fetches the value of the status byte, which may be further interpreted. For this
to wo rk properlythe valueof “Disable Auto Serial Polling ” must be set to “off ” in the GPIB handler (use
IBCONF.EXE to check):
CMD$=“*CLS; INE 1; *SRE 1”
CALL IBWRT(SCOPE%,CMD$)
MASK% = &HC800
CALL IBWAIT(SCOPE%,MASK%)
IF (IBSTA% AND &HC000) <> 0 THEN PRINT “GPIB or Timeout Error” : STOP
CALL IBRSP(SCOPE%,SPR%)
PRINT “Status Byte =.”, SPR%
Board-le vel function calls can dea l simu ltaneously with seve ra l oscilloscopes attache d to thesameinterface
board. Refer to theNational Instruments manual.
NOTE: After the serial po ll is comp leted, the RQS bit in the STB status register is cleared. N ote that
the otherSTB registerbits rem ainset until theyare cleared by mean s of a “* CL S” comm and or the
oscilloscopeis reset. If these bits are no t cleared, theycann o t gener ate anoth erinterrup t.
DO A PARALLEL POLL
Like serial polling , this is onlyuse ful w ith several oscilloscopes. Thecontroller simultane ously rea d s the
Individua l STatus bit (IST) of all oscilloscopes to determine whic h one need s service. This method allow s up
to eight different oscilloscop e s to be polled at the sametime .
When a parallel poll is initiated, each oscilloscope returns a status bit over one of the DIO data lines. Devices
ma yrespo ndeither individ u a lly, usinga sep a rateDIO line , or collectively on a singledata line . Data-line
assignments are made by the controller using a Parallel Poll Configure (PPC) sequence.
In thefollowingexample, thecommandINE 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 w ill be summarized in the IST status bit. The command *PRE 1 ena bles the INB bit to set the IST bit
22ISSUED: January 2002L TXXX-RCM-E Rev B
C HAPTER T WO:
w h e n ever it is itself set. Once pa rallel pollin ghas be e nestablish e d , the pa rallel-poll status is exam in e duntil a
change on data bus line DI02 takes place.
Stage 1
1.Enablethe INE and PRE reg isters
2.Configure the controller for parallel poll
3.Instruct Wa verunner to respond on data line 2 (DI02) with these commands:
In the above example, board-level GPIB function calls are used. It is assumed that the controller (board) and
Wa verunner (device) are respectively located at addresses 0 and 4.
LTXXX-RCM-E RevBISSUED: January 200223
P ART O NE: ABOUT REMOTE CONTROL
The listener and talker addresses for the controller and Waverunner are:
L OGIC DEVICELISTEN ER ADDR ESSTAL KER ADDR ESS
External Controller32 ASCII<space>)64(ASCII @ )
W averunne r32+4= 36 (ASCII $)64+4=68 (ASCII D)
PERFOR M AN *IST PO LL
Yo ucan also read the state of the Individua l STatus bit (IST) returnedin parallel pollin gby sendin gthe
*IST? query. To enable this poll mode, you must intialize Waverunner as for parallel polling by writing into
thePR E register.Since*IST emulates parallel polling, apply this method whe rever parallel polling is not
supported by the controller. 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 wheneve r it is set. The command CHDR OFF suppresses the command header
in the oscilloscop e’s respons e ,simplifying the interpretation. The status of the IST bit is then continuou sly
monitoreduntil set bythe oscilloscop e:
CMD$=“CHDR OFF; INE 1; *PRE 1”
CALL IBWRT(SCOPE%,CMD$)
LOOP% = 1
WHILE LOOP%
CMD$=“*IST?”
CALL IBWRT(SCOPE%,CMD$)
CALL IBRD(SCOPE%,RD$)
IF VAL(RD$) = 1 THEN LOOP% = 0
WEND
N OT E : T he characters “?” and “_” appearing in the command strings stand for unlisten and untalk
r e spectiv e l y. The yar eused to set thedevi ce s to a “known” state. To shortenthesize of th epr ogr am
ex am p l es, device talking and listen in g initialization instructions ha v e beengro up ed into char acter
chains. T hey are:
CMD1$ = “?_@$” Unlisten, Untalk, PC talker, DSO listener.
Theremotemessagecodeforexecutingaparallelresponseinbinaryformis01101PPP,wherePPP
specifies the data line. Because data line 2 is selected, the identification code is 001, which results in
the code 011 01 001(binary) or &H 69 (hex). See Table 38 of the IE E E 488-1978 Standard
forfurtherdetails.
24ISSUED: January 2002L TXXX-RCM-E Rev B
Loading...
+ 256 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.