HPlogo HP-UX Reference Volume 4 of 5 > h

hpib_wait_on_ppoll(3I)

Series 800 Only
» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

hpib_wait_on_ppoll() — wait until a particular parallel poll value occurs (OBSOLETED AT 10.30)

SYNOPSIS

#include <dvio.h>

int hpib_wait_on_ppoll(int eid, int mask, int sense);

DESCRIPTION

hpib_wait_on_ppoll() waits for a parallel poll response to occur on one or more lines. eid is an entity identifier of an open HP-IB raw bus device file.

The mask argument specifies on which lines the parallel poll response is expected. The value of mask is treated as an eight-bit binary number where the least significant bit corresponds to line DIO1; the most significant bit to DIO8. For example, if you want to wait for a response on lines DIO2 and DIO6, the corresponding binary number is 00010010, so a hexadecimal value of 12 should be passed as the mask argument.

The sense argument specifies what response is expected on the selected lines. The value of sense is constructed in the same way as mask; eight bits for eight lines. If a bit in sense is set, the function returns when the line corresponding to that bit is cleared. If a bit in sense is clear, the function returns when the corresponding line is set. Using the previous example, if mask is 0x12 and sense is 00000010 (0x02 hexadecimal), the function returns when line DIO5 is set, or when line DIO2 is clear.

RETURN VALUE

hpib_wait_on_ppoll() returns a value of -1 if an error or timeout condition occurs. Upon successful completion, the function returns the response byte XOR-ed with the sense value and AND-ed with the mask.

ERRORS

hpib_wait_on_ppoll() fails and sets errno to indicate the error if any of the following is true:

[EACCES]

The interface associated with this eid is locked by another process and O_NDELAY is set for this eid (see io_lock(3I)).

[EBADF]

The eid argument is not a valid open entity identifier.

[ENOTTY]

The eid argument does not refer to an HP-IB raw bus device file.

[EINVAL]

An invalid mask is received.

[EIO]

The interface is not currently the active controller.

[ETIMEDOUT]

A timeout occurred (Series 800 only).

DEPENDENCIES

If the interface is not currently the active controller, hpib_wait_on_ppoll() sets errno to [EACCES] instead of to [EIO].

AUTHOR

hpib_wait_on_ppoll() was developed by HP.

© Hewlett-Packard Development Company, L.P.