National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 4 GPIB/GPIB-488.2 Library
© National Instruments Corporation 4-17 LabWindows/CVI Standard Libraries
CallbackFunction
The callback function must have the following form.
void CallbackFunctionName (int boardOrDevice, int mask, void *callbackData);
The mask and callbackData parameters are the same values that were passed to
ibInstallCallback.
If invoked because of an SRQI or RQS condition, the callback function should call the ibrsp
function to read the status byte. For an SRQI (board-level) condition, calling the ibrsp
function is necessary to cause the requesting device to turn off the SRQ line.
char statusByte;
ibrsp (device, &statusByte);
If invoked because an asynchronous I/O operation (started by ibrda, ibwrta, or ibcmda)
completed, the callback function should contain the following call:
ibwait (boardOrDevice, TIMO | CMPL);
The ibcnt and ibcntl status variables are not updated until this call to ibwait is made.
See Also
ibnotify
ibNotify
int status = ibnotify (int boardOrDevice, int eventMask,
GpibNotifyCallback_t callbackFunction, void *callbackData);
Note: This function is available only on Windows 95 and NT. On UNIX, use the ibsgnl
function.
Purpose
This function allows you to install an asynchronous callback function for a specified board or
device. If you want to install a synchronous callback, use the ibInstallCallback function
instead.
The callback function is called when any of the GPIB events specified in the eventMask
parameter have occurred on the specified board or device. Asynchronous callbacks can be called
at any time while your program is running. You do not have to allow the system to process
events. Because of this, you are restricted in what you can do in the callback. See the
Restrictions on Operations in Asynchronous Callbacks discussion below.