Talker/listener applications, Serial polling – National Instruments NI-488.2 User Manual

Page 87

Advertising
background image

Chapter 8

NI-488.2 Programming Techniques

NI-488.2 User Manual

8-12

ni.com

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,

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. 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 acting as a voltmeter.

For designing more complex GPIB devices, you can use our NI-Device
product. Please refer to our web site for more information.

Serial Polling

You can use serial polling to obtain specific information from GPIB
devices when they request service. When the GPIB SRQ line is asserted,
it signals the Controller that a service request is pending. The Controller
must then determine which device asserted the SRQ line and respond
accordingly. The most common method for SRQ detection and servicing
is the serial poll. This section describes how to set up your application to
detect and respond to service requests from GPIB devices.

Advertising