Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

HPIB_IO(3D)

NAME

hpib_io − perform I/O with an HP-IB channel from buffers

SYNOPSIS

#include <libdvio.h>
int hpib_io(eid, iovec, iolen)
int eid;
struct iodetail ∗iovec;
int iolen;

HP-UX COMPATIBILITY

Level: Device I/O Library − HP-UX/EXTENDED

Origin: HP

DESCRIPTION

Hpib_io enables you to perform and control read and/or write operations on the specified HP-IB bus.  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.  Iovec is a pointer to an array of structures of the form:

struct iodetail {
char mode;
char terminator;
int  count;
char ∗buf;
};

The iodetail structure is defined in the include file libdvio.h.  Iolen specifies the number of structures in iovec. 

The mode parameter in the iodetail structure describes what is to be done  during I/O on the buffer pointed to by buf.  Mode is  constructed by OR-ing flags from the following list:

Only one of the following two flags must be specified:

HPIBREAD Perform  a read  of the HP-IB bus, placing data into the accompanying buffer. 

HPIBWRITE Perform  a write to the HP-IB  bus, using  data from  the accompanying buffer. 

The following flags may be used in most combinations (not all combinations are valid), or not at all:

HPIBATN Data is written with ATN enabled. 

HPIBEOI Data  written  is terminated with EOI (this flag  is ignored when HPIBATN is enabled). 

HPIBCHAR Data  read  is terminated with the character given in  the  terminator  element of the iodetail structure. 

Terminator describes the termination character, if any, that should be checked for on input.  Count is an integer specifying the maximum number of bytes to be transferred. 

A read operation terminates  when  either count  is matched, an EOI is detected, or the  designated terminator is  detected (if HPIBCHAR is set in mode). 

A write operation terminates when count is matched, and the  final byte is sent with EOI asserted (if HPIBEOI is set in mode). 

If  HPIBATN is set in mode, then write operations occur with ATN enabled.  Setting HPIBATN for a read  operation is ignored and has no effect. 

The members of the iovec  array are accessed in order. 

RETURN VALUES

If all transactions are successful, hpib_io  returns a  zero and updates the count element in each structure in the iovec array to reflect the actual number of bytes read or written. 

If an  error  is  encountered  during a  transaction  defined by an element of iovec, hpib_io returns without completing any transactions that might follow.  In particular, if an error occurs, hpib_io returns a −1, and the count element of the transaction which caused the error is set to −1. 

DIAGNOSTICS

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

eid does not refer to an open file [EBADF];

eid does not refer to an HP-IB raw bus device file [ENOTTY];

a timeout occurs [EIO];

eid is not the active controller [EIO]. 

Hewlett-Packard  —  last mod. May 11, 2021

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