Waiting For A Parallel Poll Response; Calculating The Mask - HP 9000 Series 300 Tutorials Manual

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

Waiting For a Parallel Poll Response
Subroutine hpib_wai t_on_ppoll allows you to wait for a specific parallel
poll response from one or more devices. The effect of this is similar to
using hpib_status_wai t to wait for assertion of SRQ as discussed earlier.
hpib_wai t_on_ppoll provides a mechanism for waiting until a specific device
requests service while hpib_status_wai t only waits until any device requests
service.
To call hpib_wai t_on_ppoll, use the form:
hpib_wait_on_ppoll(eid. mask. sense);
where eid is the entity identifier for an open interface file, mask is an integer
whose binary value identifies which parallel poll lines are to be monitored for
a request, and sense is an integer whose binary value identifies which lines
respond with an inverted logic sense (device responds with 0 when it wants
service instead of the usuall). hpib_wait_on_ppoll returns the response byte
XORed with the sense value then ANDed with the mask value, unless an error
occurs, in which case it returns -1.
Calculating the mask
hpib_wai t_on_ppoll uses only the least significant byte of the mask integer,
which means that the integer's remaining bytes can contain anything. For
simplicity, the examples in this discussion set the upper bytes to zero.
The value for mask is determined as follows:
1. Decide which parallel poll lines (the 8 data lines labelled DO through
D7) are to be monitored for service requests.
2. Set up an 8-bit binary number where the bits associated with each
line being monitored are set to 1 and all remaining bits are O. (DO is
associated with the least significant bit of the binary number, and D7
with the most significant.)
3. Given the binary number from step 2, calculate its decimal value. The
result is the correct value for mask.
3-42
Controlling the HP-IB Interface

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents