GxAoArbSetupStreamingInterrupt

Purpose

Configures the ARB streaming interrupt by setting which ARB groups are used as a source for an interrupt and setting the interrupt call back function and its optional parameter.

Applies

GX1649-1, GX1632e

Syntax

GxAoArbResumeStreamingInterrupt (nHandle, wGroups, pInterruptCallback, pvInterruptCallbackParam, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX1649 or GX1632e board.
wGroups
WORD
Set which groups can cause an interrupt, encoded in 4 bits of wGroups, bit 0 corresponds to Group A and bit 3 corresponds to Group D
pInterruptCallback
Gt_EventCallback
The user defined callback function for the interrupt handler
pvInterruptCallbackParam
LPVOID
Optional parameter to be passed to the user defined call back function defined by the pInterruptCallback parameter
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

This function sets the board up for streaming operation. This function is used to select which ARB groups will cause an interrupt to be generated.

GX1649-1: When an ARB group is in streaming mode, it will cause the board to generate a PCI interrupt when the streaming FIFO is half full.

GX1632e: When an ARB group is in streaming mode, it will generate an MSI interrupt after data has been transferred from the PC to the board if there is room for more data.  If there is not enough room for more data, the interrupt will be sent as soon as more room becomes available.  This function uses the bucket sizes specified in previous calls to GxAoArbSetGroupClock to determine how much memory to allocate.  If bucket sizes are changed, you must call this function again.

This function assigns a user defined call back function (pInterruptCallback) to the PCI interrupt. The user defined callback function must use the following function prototype:

LONG CallBackFunction (SHORT nHandle, SHORT enEventType, LPVOID pvUserData)

LabVIEW uses User Events instead of callbacks. When operating the AO board from LabVIEW, a User Event reference number must be generated with “Create User Event” VI and passed to this procedure in pvInterruptCallbackParam.  The pInterruptCallback parameter should point to NULL or use a constant of 0.  An example of this is included in GX1632eStreamingExample.vi.

In lieu of the CallBackFunction prototype used above, the interrupt event cluster used in ‘Create User Event’ should consist of an int16 to represent nHandle, an int16 to represent enEventType, and a uint32 to represent pvUserData.

Example

The following example configures the streaming interrupt to use group C ARB and set the interrupt handler to the user defined function CallBackFunction with no optional parameter:

 

SHORT nStatus;

 

GxAoArbSetupStreamingInterrupt (nHandle, 0x4, CallBackFunction, NULL, &nStatus);

 

See Also

GxAoArbEnableGroupStreaming, GxAoArbResumeStreamingInterrupt, GxAoArbWriteStreaming, GxAoGetErrorString