Example 5: Service Requests - National Instruments NI-488.2M Software Reference Manual

For os/2
Hide thumbs Also See for NI-488.2M:
Table of Contents

Advertisement

Application Examples

Example 5: Service Requests

This example illustrates how an application communicates with a GPIB device
that uses the GPIB service request (SRQ) line to indicate that it needs attention.
A graphic arts designer is transferring digital images stored on her computer to a
roll of color film by using a GPIB digital film recorder. A GPIB cable connects
the GPIB port on the film recorder to the IEEE 488.2 interface board installed in
her computer. She has installed the NI-488.2M software package on the host
computer and is familiar with the programming instructions for the film recorder,
as described in the user manual provided by the manufacturer. She places a fresh
roll of film in the camera and launches a simple application she has written using
high-level GPIB commands. With the aid of the application, she records a few
images on film. The following steps correspond to the program flowchart in
Figure 2-5.
1.
The application initializes the GPIB by bringing the interface board in the
computer online.
2.
The application brings the film recorder to a ready state by issuing a device
clear instruction. The film recorder is now set up for operation using its
default values. (The graphic arts designer has previously established that the
default values for the film recorder are appropriate for the type of film she is
using.)
3.
The application advances the new roll of film into position so the first image
can be exposed on the first frame of film. This is done by sending the
appropriate instructions as specified in the film recorder programming guide.
4.
The application, by waiting for RQS (request for service), waits for the film
recorder to signify that it is done loading the film. The film recorder asserts
the GPIB SRQ line when it has finished loading the film.
5.
As soon as the film recorder asserts the GPIB SRQ line, the application's
wait for the RQS event completes. The application serial polls the device by
sending a special command message to the film recorder that directs it to
return a response in the form of a serial poll status byte. This byte contains
information indicating what kind of service the film recorder is requesting or
what condition it is flagging. In this example, it indicates the completion of
a command.
NI-488.2M SRM for OS/2
2-10
© National Instruments Corp.
Chapter 2

Advertisement

Table of Contents
loading

Table of Contents