HP 9000 Series 300 Tutorials Manual page 105

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

Advertisement

The four devices on the bus use mixed (both ground- and high-true logic), the
sense value must be determined. Devices responding on lines Dl and D2 use 0
to request service, so the sense value is:
Binary:
Decimal:
00000 1 1 0
6
Now that the mask and sense values have been determined, the code segment
that makes the call to hpib_wai t_on_ppoll can be written:
#include <fcntl.h>
#include <errno.h>
mainO
{
}
int eid;
if ((eid
=
open("/dev/raw_hpib", D_RDWR»
==
-1) {
printf("open failed, errno
=
%d\n", errno);
exit(2);
}
io_reset(eid);
io_timeout_ctl(eid,10000000);
/*Set a 10-second timeout*/
if (hpib_wait_on_ppoll(eid, 15, 6)
==
-1)
printf("either a timeout or error occurred\n");
else
service_routine();
In the code segment shown, service_routine is executed only if one of the
four devices requests service during the parallel poll. service_routine should
contain code segments to service all devices on the bus, either individually or
as a group. See the appropriate hardware-specific appendix for any restrictions
that may apply to your system.
Controlling the HP-IB Interface
3-45

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents