Calculating Talk And Listen Addresses - HP 9000 Series 300 Tutorials Manual

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents

Advertisement

Calculating Talk and Listen Addresses
Before devices can be addressed to talk or listen, their HP-IB bus addresses
must be known. The bus address of the computer interface is easily obtained
by using hpi b_bus_status as shown in this program code segment:
#include <dvio.h>
#include <fcntl.h>
#include <errno.h>
main()
{
int eid. address;
if «eid
=
open("/dev/raw_hpib". O_RDWR»
==
-1) {
printf("open failed. errno
=
%d\n". errno);
exit(2);
}
}
where eid is the entity identifier for the interface file and
CURRENT_BUS_ADDRESS indicates a request for the interface
HP-IB bus address.
To determine the bus address of other devices on the bus, refer to installation
and operating manuals for each device being used (certain HP-IB addresses
may be reserved for specific devices on some systems).
Once device addresses are known for all devices of interest, setting up talk and
listen addresses is a fairly simple matter.
HP-IB commands are set up as a single ASCII character transmitted while
ATN is asserted. However, it is usually much easier to calculate addresses
based on bus address rather than looking up the corresponding ASCII
character for each address. Bus addresses range from 0 through 30, and talk
and listen addresses are derived through decimal addition as follows:
talk_address
=
64
+
bus~address
listen_address
=
32
+
bus_address
where talk_address is the decimal equivalent of the binary bit pattern that
represents the ASCII talk address command character. Likewise, listen_address
is the decimal representation of the ASCII listen address command character.
Controlling the Hp .. IB Interface
3 .. 23

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents