Chapter 3 3-9
GPIB Programming
GPIB Operation
Data Bus
The data bus consists of 8 bidirectional lines that are used to transfer data from one device
to another. Programming commands and data transmitted on these lines are typically
encoded in ASCII, although binary encoding is often used to speed up the transfer of large
arrays. Both ASCII and binary data formats are available to the analyzer. In addition,
every byte transferred over GPIB undergoes a handshake to insure valid data.
Handshake Lines
A three-line handshake scheme coordinates the transfer of data between talkers and
listeners. To ensure data integrity in multiple-listener transfers, this technique forces data
transfers to occur at the transfer rate of the slowest device connected to the interface. With
most computing controllers and instruments, the handshake is performed automatically,
making it transparent to the programmer.
Control Lines
The data bus also has five control lines. The controller uses these lines to address devices
and to send bus commands.
IFC (Interface Clear) This line is used exclusively by the system controller. When this
line is true (low), all devices (whether addressed or not) unaddress and revert to an idle
state.
ATN (Attention) The active controller uses this line to define whether the information
on the data bus is command-oriented or data-oriented. When this line is true (low), the bus
is in the command mode, and the data lines carry bus commands. When this line is false
(high), the bus is in the data mode, and the data lines carry device-dependent instructions
or data.
SRQ (Service Request) This line is set true (low) when a device requests service and
the active controller services the requesting device. The network analyzer can be enabled
to pull the SRQ line for a variety of reasons such as requesting control of the interface, for
the purposes of printing, plotting, or accessing a disk.
REN (Remote Enable) This line is used exclusively by the system controller. When this
line is set true (low), the bus is in the remote mode, and devices are addressed by the
controller to either listen or talk. When the bus is in remote mode and a device is
addressed, it receives instructions from the system controller via GPIB rather than from
its front panel (pressing returns the device to front-panel operation). When this
line is set false (high), the bus and all of the connected devices return to local operation.
EOI (End or Identify) This line is used by a talker to indicate the last data byte in a
multiple-byte transmission, or by an active controller to initiate a parallel-poll sequence.
The analyzer recognizes the EOI line as a terminator, and it pulls the EOI line with the
last byte of a message output (data, markers, plots, prints, error messages). The analyzer
does not respond to parallel poll.
Local