General concepts, Device vs. board i/o, Device i/o – Measurement Computing GPIB-488 User Manual
Page 11: General concepts -2, Device vs. board i/o -2 device i/o -2

Chapter 2
Programming with the GPIB Library
2-2
GPIB-488
General Concepts
This section explains the difference between routines which use Device I/O
and those which use Board I/O, the use of device handles, and the global
variables used by the library routines.
Device vs. Board I/O
The most typical GPIB operations are sending commands to a device
attached to the bus and reading back responses. To do this, program the
GPIB board to execute these steps:
1.
Address the selected device as a Listener.
2.
Send the secondary address if used.
3.
Address the board itself as the GPIB Talker.
4.
Send the command bytes to the device.
5.
Address the board itself as the Listener.
6.
Read the response from the device.
7.
Send the GPIB Unlisten (UNL) message.
8.
Send the GPIB Untalk (UNT) message.
The original GPIB library interface is comprised of two different types of
routines: Board I/O and Device I/O. These routines are described in
Chapter 3,
. You can program the board
using either Board I/O routines or Device I/O routines to perform the
sequence of operations outlined above.
The 488.2 library is all "Board I/O" in that you always supply the board ID
and the device address. Refer to Chapter 4,
Device I/O
It is usually easier to use the Device I/O routines. Device I/O is very simple
to use and understand. Device I/O routines are higher-level routines which
conceal most of the underlying complexity of GPIB operations. The Device
I/O routines automatically take care of all of the low-level details involving
GPIB messages and addressing. For example, to accomplish the seven
steps listed above, you use only three routines:
•
ibdev
—to open the device
•
ibwrt
—to send the instrument command
•
ibrd
—to read the data back from the device