beautypg.com

Ibrsp, Ibrsp -41 – Measurement Computing GPIB-488 User Manual

Page 54

background image

Chapter 3

GPIB 488.1 Library Reference

GPIB-488

3-41

Programming Reference Manual

IBRSP

Serial polls a device.

Syntax

C

ibrsp (int device, char *serialpollbyte)

Parameters

device

is an integer containing the device handle.

Returns

serialpollbyte

will contain the serial poll response byte of the device. The serial poll

response byte is device-specific with the exception of bit 6. If bit 6 (hex 40) is set, then the
device is requesting service. Consult the device's documentation for more information.

ibsta

will contain a 16-bit status word as described in Appendix B,

IBSTA

.

iberr

will contain an error code, if an error occurred.

Usage Notes

If the automatic serial polling feature is enabled, the specified device may have been
automatically polled previously. If it has been polled and a positive response was obtained,
the RQS bit of

ibsta

is set on that device. In this case

ibrsp

returns the previously acquired

status byte. If the RQS bit of

ibsta

is not set during an automatic poll, it serial polls the

device. This routine is used to serial poll one device, and obtain its status byte or to obtain a
previously stored status byte. If bit 6 (the hex 40 bit) of the response is set, the device is
requesting service.

When a serial poll occurs, the following sequence of events happens. The board sends an UNL
(unlisten) command. It then addresses itself as a listener and sends a SPE (Serial Poll Enable)
Byte. It then addresses a device as a talker. The board then reads the serial poll response byte
from the device. The board then sends a serial poll disable (SPD) and untalks and unlistens
all devices.

Example

Returns the serial response byte (into

serialpollbyte

) of a device at PAD 1.

C

int dev1;

char serialpollbyte;

dev1 = ibdev (0,1,0,13,1,0);

ibrsp (dev1, &serialpollbyte);