Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

hpib_bus_status(3I)  —  Series 800 Only

NAME

hpib_bus_status() − return status of HP-IB interface

SYNOPSIS

#include <dvio.h>

int hpib_bus_status(int eid, int status);

DESCRIPTION

hpib_bus_status() obtains 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(), dup(), fcntl(), or creat() 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 that do not support sensing the NDAC line return an error. 

RETURN VALUE

The value returned by hpib_bus_status() depends upon the value of status. If status is CURRENT_BUS_ADDRESS, the return value is either the HP-IB bus address or −1 if an error occurred.  If status is any of the other values, 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/400:

The status of signal 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 fail and set errno (see errno(2)) to EINVAL. 

AUTHOR

hpib_bus_status() was developed by HP. 

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026