Chapter 7 NI-488.2 Programming Techniques
© National Instruments Corporation 7-11 NI-488.2 User Manual for Windows
Device-Level Calls and Bus Management
The device-level traditional NI-488.2 calls are designed to perform all of
the GPIB management for your application. However, the NI-488.2 driver
can handle bus management only when the GPIB interface 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 interface the CIC:
• If your GPIB interface 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 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 NI-488.2 Configuration utility to
activate the CIC protocol. If the interface is not CIC, and you make a
device-level call with the CIC protocol enabled, the following
sequence occurs:
1. The GPIB interface asserts the SRQ line.
2. The current CIC serial polls the interface.
3. The interface returns a response byte of hex 42.
4. The current CIC passes control to the GPIB interface.
If the current CIC does not pass control, the NI-488.2 driver returns the
ECIC error code to your application. This error can occur if the current CIC
does not understand the CIC protocol. If this happens, you could send a
device-specific command requesting control for the GPIB interface. Then,
use a board-level
ibwait
command to wait for CIC.
Talker/Listener Applications
Although designed for Controller-In-Charge applications, you can also use
the NI-488.2 software in most non-Controller situations. These situations
are known as Talker/Listener applications because the interface is not the
GPIB Controller.
A Talker/Listener application typically uses
ibwait
with a mask of 0 to
monitor the status of the interface. Then, based on the status bits set in
ibsta
, the application takes whatever action is appropriate. For example,