An Example Configuration - 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

bus_address is the decimal value of the HP-IB bus address for the device being
addressed.
The talk and listen addresses MTA ("my talk address") and MLA ("my listen
address") for the computer interface are derived similarly as follows:
MTA
=
hpib_bus_status(eid, CURRENT_BUS_ADDRESS)
+
64;
MLA
=
hpib_bus_status(eid, CURRENT_BUS_ADDRESS)
+
32;
An Example Configuration
Assuming that the computer's HP-IB interface is currently the Active
Controller, the following code segment establishes the interface as the bus
talker. Two devices at HP-IB addresses 4 and 8 are designated as bus listeners.
#include <dvio.h>
#include <fcntl.h>
#include <errno.h>
rnainO
{
}
int
eid, MTA;
char command[5];
if ((eid
=
open (1/dev/raw_hpib", D_RDWR))
==
-1) {
printf(lIopen failed, errno
=
%d\n", errno);
exit(2);
}
I*calculate My Talk Address*1
MTA
=
hpib_bus_status(eid, CURRENT_BUS_ADDRESS)
+
64;
command[O]
=
95;
1*
UNTALK command*1
command[1]
=
63;
1*
UNLISTEN command*1
command[2]
=
MTA;
1*
interface talk address*1
command[3]
=
32
+
4;
1*
listen address for device at bus address
4*1
command[4]
=
32
+
8;
1*
listen address for device at bus address
8*1
hpib_send_cmnd(eid, command, 5);
3-24
Controlling the HP-IB Interface

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents