ibrsv2

Name

ibrsv2 -- request service (board)

Synopsis

#include <gpib/ib.h>

int ibrsv2(int ud, int status_byte, int new_reason_for_request);

Description

The serial poll response byte of the board specified by the board descriptor ud is set to status_byte. A service request may be generated, cleared, or left unaffected depending on the values of MSS (bit 6 in status_byte) and new_reason_for_request.

There are three valid possibilities for MSS and new_reason_for_request. If MSS is 1 and new_reason_for_request is nonzero, then the IEEE 488.2 local message "reqt" will be set true. reqt sets local message "rsv" true which in turn causes the board to request service by asserting the SRQ line. If the MSS bit is 0 and new_reason_for_request is also 0, then the "reqf" message will be set true, causing rsv to clear and the board to stop requesting service. Finally, if MSS is 1 and new_reason_for_request is 0, then ibrsv2 will have no effect on the service request state (it will only update the status byte). The fourth possibilty of MSS is 0 (which implies no service request) and new_reason_for_request is nonzero (which implies there is a service request) is contradictory and will be rejected with an EARG error.

Boards will also automatically stop requesting service when they are serial polled by the controller.

This function follows the preferred implementation technique described in IEEE 488.2 section 11.3.3.4.1. It can be used to avoid the spurious requests for service that ibrsv() is prone to. However, not all drivers/hardware implement support for this function. In such a case, this function may result in a ECAP error, and you will have to fall back on using the simpler ibrsv().

If you are implementing a 488.2 device, this function should be called every time either the status byte changes, or the service request enable register changes. The value for new_reason_for_request may be calculated from:

	new_reason_for_request = (status_byte &	service_request_enable) &
                         	~(old_status_byte & old_service_request_enable);
	

Return value

The value of ibsta is returned.