Chapter 6
GPIB Programming Techniques
© National Instruments Corp.
6-3
NI-488.2M UM for Windows NT
The second byte is a GPIB secondary command that indicates the number of meters of
cable in your system. It is called the Configure (CFGn) message. Because HS488 can
operate only with cable lengths of 1 to 15 meters, only CFGn values of 1 through 15
(hex 61 through 6F) are valid. If the cable length was configured properly in
wibconf
,
you can determine how many meters of cable are in your system by calling
ibask
(option
IbaHSCableLength
) in your application program. For CFE and CFGn
messages, refer to Appendix A, Multiline Interface Messages, in the NI-488.2M Function
Reference Manual for Windows NT .
System Configuration Effects on HS488
Maximum data transfer rates can be limited by your host computer and GPIB system
setup. For example, even though the theoretical maximum transfer rate with HS488 is
8 Mbytes/s, the maximum transfer rate obtainable on PC -compatible computers with an
ISA bus is 2 Mbytes/s. The same IEEE 488 cabling constraints for a 350 ns T1 delay
apply to HS488. As you increase the amount of cable in your GPIB configuration, the
maximum data transfer rate using HS488 decreases. For example, two HS488 devices
connected by two meters of cable can transfer data faster than three HS488 devices
connected by four meters of cable.
Waiting for GPIB Conditions
You can use the
ibwait
function to obtain the current
ibsta
value or to suspend your
application until a specified condition occurs on the GPIB. If you use
ibwait
with a
parameter of zero, it immediately updates
ibsta
and returns. If you want to use
ibwait
to wait for one or more events to occur, then pass a wait mask to the function.
The wait mask should always include the TIMO event; otherwise, your application is
suspended indefinitely until one of the wait mask events occurs.
Device-Level Calls and Bus Management
The NI-488 device-level calls are designed to perform all of the GPIB management for
your application program. However, the NI-488.2M driver can handle bus management
only when the GPIB interface board is CIC (Controller-In-Charge). Only the CIC is able
to send command bytes to the devices on the bus to perform device addressing or other
bus management activities. Use one of the following methods to make your GPIB board
the CIC:
•
If your GPIB board is configured as the System Controller (default), it automatically
makes itself the CIC by asserting the IFC line the first time you make a device-level
call.
•
If your setup includes more than one Controller, or if your GPIB interface board is
not configured as the System Controller, use the CIC Protocol method. To use the
protocol, issue the
ibconfig
function (option
IbcCICPROT
) or use the
ibconf
configuration utility to activate the CIC protocol. If the interface board is not CIC,