Chapter 4 GPIB/GPIB-488.2 Library
© National Instruments Corporation 4-15 LabWindows/CVI Standard Libraries
The callback function is called when any of the GPIB events specified in the Event Mask
parameter have occurred on the board or device, but only while you allow the system to process
events. The system can process events when you call ProcessSystemEvents or
GetUserEvent, or when you have called RunUserInterface and none of your callback
functions are currently active. The callbacks are termed "synchronous" because they can be
invoked only in the context of normal event processing.
Unlike asynchronous callbacks, there are no restrictions on what you can do in a synchronous
callback. On the other hand, the latency between the occurrence of a GPIB event and the
invocation of the callback function is greater and more unbounded with synchronous callbacks
than with asynchronous callbacks.
Only one callback function can apply for each board or device. Each call to this function for the
same board or device supersedes the previous call.
To disable callbacks for a board or device, pass 0 for the event Mask parameter.
To use this function with the NI-488.2M (native 32-bit) driver, you must have one of the
following versions.
For Windows 95: Version 1.1 or later.
For Windows NT: Version 1.2 or later.
If you use the NI-488.2 driver (the Windows 3.1 driver or the compatibility driver in Windows 95),
you must pass a board index for the first parameter, and you can use only SRQI or CMPL for the
event mask parameter.
Parameters
Input boardOrDevice integer
(short integer on
Windows 3.1)
A board index, or a board or device descriptor
returned by OpenDev, ibfind, or ibdev.
(On Windows 3.1, must be a board index).
eventMask integer
(short integer on
Windows 3.1)
Specifies the events upon which the callback
function is called. Pass 0 to disable callbacks.
See discussion below.
callbackFunction GPIBCallbackPtr The name of the user function that is called
when the specified events occur. See
discussion below.
callbackData void pointer A pointer to a user-defined four-byte value that
is passed to the callback function.