HPlogo HP-UX Reference Volume 4 of 5 > h

hpib_spoll(3I)

Series 800 Only
» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

hpib_spoll() — conduct a serial poll on HP-IB bus (OBSOLETED AT 10.30)

SYNOPSIS

#include <dvio.h>

int hpib_spoll(int eid, int ba);

DESCRIPTION

hpib_spoll() conducts a serial poll of the specified device. eid is an entity identifier of an open HP-IB raw bus device file obtained from an open(), dup(), fcntl(), or creat() call. ba is the bus address of the intended device.

hpib_spoll() Polls a single device for its response byte. The information stored in the response byte is device specific with the exception of bit 6. If bit 6 of the response byte is set, the addressed device has asserted the SRQ line, and is requesting service (note that the least significant bit of the response byte is bit 0).

Not all devices respond to the serial poll function. Consult device documentation. Specifying a device that does not support serial polling may cause a timeout error or suspend your program indefinitely. The interface cannot serial poll itself. The interface must be the active controller.

RETURN VALUE

If hpib_spoll() is successful, the device response byte is returned in the least significant byte of the return value. Otherwise, -1 is returned, indicating an error.

ERRORS

hpib_spoll() fails under the following circumstances, and sets errno (see errno(2)) to the value in square brackets:

[EBADF]

eid does not refer to an open file.

[ENOTTY]

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

[EIO]

the interface is not the active controller.

[ETIMEDOUT]

the device polled did not respond before timeout.

[EINVAL]

ba is the address of the polling interface itself.

[EACCES]

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

DEPENDENCIES

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

AUTHOR

hpib_spoll() was developed by HP.

© Hewlett-Packard Development Company, L.P.