ibrsp

Name

ibrsp --  read status byte / serial poll (device)

Synopsis

#include <gpib/ib.h>

int ibrsp(int ud, char *result);

Description

ibrsp() obtains the status byte from the device specified by ud. The status byte is stored in the location specified by result.

If automatic serial polling is enabled on the board controlling the device, the status byte is automatically read and queued whenever the device requests service. If the status byte queue is not empty ibrsp() obtains the status byte information from the queue. If the queue is empty the status byte is obtained by serial polling the device. Automatic serial polling is controlled with ibconfig(). The contents of the status byte returned in result are device specific. Refer to the device manufacturer's documentation for details. For devices conforming to the IEEE488.1 or 2 specification the bits defined in the table below are available if enabled in the device's Status Byte Enable register.

Table 1. Standard IEEE.488 GPIB status byte bits

constantvaluedescription
IbStbRQS0x40The request service bit is set when device asserts RQS. It is cleared by serial polling the device. Supported by devices conforming to IEEE 488.1 or IEEE 488.2.
IbStbESB0x20The event-status bit is set when there are one or more bits set in the device's Standard Event Status Register. It is cleared by reading the Standard Event Status Register. For devices conforming to IEEE 488.2 only.
IbStbMAV0x10The message available bit indicates whether or not the device's data output queue is empty. Whenever the device has data available, this bit will be set. It is cleared when the output queue is empty. The queue is emptied by reading data from the device with ibrd() for example. For devices conforming to IEEE 488.2 only.

Return value

The value of ibsta is returned.