HPIB_BUS_STATUS(3I)
NAME
hpib_bus_status − return status of HP-IB interface
SYNOPSIS
#include <dvio.h>
int hpib_bus_status (eid, status);
int eid, status;
DESCRIPTION
Hpib_bus_status enables you to determine various status information about an HP-IB channel. Eid is an entity identifier of an open HP-IB raw bus device file obtained from an open(2), dup(2), fcntl(2), or creat(2) call. Status is an integer determining what status information is returned for a particular call. The values defined for status and their associated meanings are:
REMOTE_STATUS
Is the channel currently in remote state?
SRQ_STATUS
What is the current state of the SRQ line?
NDAC_STATUS
What is the current state of the NDAC line?
SYS_CONT_STATUS
Is the channel currently system controller?
ACT_CONT_STATUS
Is the channel currently active controller?
TALKER_STATUS
Is the channel currently addressed as talker?
LISTENER_STATUS
Is the channel currently addressed as listener?
CURRENT_BUS_ADDRESS
What is the channel’s bus address?
The remote state status is not defined when the interface is the active controller, although reading remote state status in such a situation is not an error. Determining the status of the NDAC line is not available on all machines, and its use is therefore discouraged to ensure compatibility among various systems. Machines which do not support sensing the NDAC line return an error.
RETURN VALUE
Hpib_bus_status’s return value depends upon the value of status. If status is CURRENT_BUS_ADDRESS, then the return value is either the HP-IB bus address or -1 if an error occurred. If status is any of the other values, then the return value is 0 if the condition is false (the line is clear), 1 if the condition is true (the line is set), or -1 if an error occurred.
ERRORS
Hpib_bus_status fails under the following conditions, 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.
[EINVAL] status is not one of the values specified above.
DEPENDENCIES
Series 300
The status of those lines being driven by the interface is undefined, although reading them in such a situation is not an error. Non-active controllers cannot sense the SRQ line. Active listeners cannot sense the NDAC line.
The HP 98625A/B HP-IB interface cannot determine the current state of the NDAC line. Attempts to read this line will fail and set errno (see errno(2)) to EINVAL.
AUTHOR
Hpib_bus_status was developed by HP.
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989