beautypg.com

Waitsrq, Waitsrq -30 – Measurement Computing GPIB-488 User Manual

Page 98

background image

Chapter 4

GPIB 488.2 Library Reference

Programming Reference Manual

4-30

GPIB-488

WaitSRQ

Wait until a device asserts SRQ.

Syntax

C

WaitSRQ(int board, short *result)

Parameters

board

is an integer which identifies the GPIB board to use for this operation. In most

applications, this value is 0.

Returns

result

indicates whether or not an SRQ occurred. If an SRQ occurs before the timeout

expires,

result

= 1. Otherwise,

result

= 0.

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

This call suspends operation until a device requests service or a timeout occurs. Follow this
call with a

FindRQS

call to determine which device needs service.

Example

Wait for a GPIB device to request service and then ascertain if device 6 or 7 requires service.

C

short addresslist[3] = {6,7,NOADDR};

short resultlist[3];

short result;

WaitSRQ (0,&result);

if (result == 1)

{FindSRQ (0, addresslist, resultlist)}