GPIB Programming Techniques Chapter 7
NI-488.2 User Manual for Windows 7-4 © National Instruments Corp.
• 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 wibconf
configuration utility to activate the CIC protocol. If the interface board is not CIC and
you make a device-level call with the CIC Protocol enabled, the following sequence
occurs:
1. The GPIB interface board asserts the SRQ line.
2. The current CIC serial polls the board.
3. The interface board returns a response byte of hex 42.
4. The current CIC passes control to the GPIB board.
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 board. 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 board is not the GPIB Controller. A
typical Talker/Listener application waits for commands from the Controller and responds
as appropriate. The following paragraphs describe some programming techniques for
Talker/Listener applications.
Waiting for Messages from the Controller
A Talker/Listener application typically uses ibwait with a mask of 0 to monitor the
status of the interface board. Then, based on the status bits set in ibsta, the application
takes whatever action is appropriate. For example, the application could monitor the
status bits TACS (Talker Active State) and LACS (Listener Active State) to determine
when to send data to or receive data from the Controller. The application could also
monitor the DCAS (Device Clear Active State) and DTAS (Device Trigger Active State)
bits to determine if the Controller has sent the device clear (DCL or SDC) or trigger
(GET) messages to the interface board. If the application detects a device clear from the
Controller, it might reset the internal state of message buffers. If it detects a trigger
message from the Controller, the application might begin an operation such as taking a
voltage reading if the application is actually acting as a voltmeter.