xPCIe-3521 API
xPCIe-3521 interrupt management functions

Functions

_INT_ i_PCIe3521_SetBoardIntRoutine (HANDLE h_DeviceHandle, void(*v_FunctionName)(HANDLE h_DeviceHandle, BYTE b_FIFOOverflow, DWORD dw_InterruptSource, DWORD dw_InterruptMask, PWORD pw_Args, DWORD dw_ArgsCount))
 
_INT_ i_PCIe3521_ResetBoardIntRoutine (HANDLE h_DeviceHandle)
 

Detailed Description

Function Documentation

_INT_ i_PCIe3521_SetBoardIntRoutine ( HANDLE  h_DeviceHandle,
void(*)(HANDLE h_DeviceHandle, BYTE b_FIFOOverflow, DWORD dw_InterruptSource, DWORD dw_InterruptMask, PWORD pw_Args, DWORD dw_ArgsCount)  v_FunctionName 
)

Install an interrupt callback function. This function will be called each time the board generate an interruption.
The value of dw_InterruptSource will enable you to determine the source of the interruption:

  • 0x1: End of sequence interrupt. When you use i_PCIe3521_Read1AnalogInput and i_PCIe3521_ReadMoreAnalogInputs with interrupt, you will receive this interrupt. The values are then available thanks to pw_Args parameter
  • 0x2: Timer interrupt.
  • 0x4: DMA interrupt. You will receive this interrupt when using i_PCIe3521_InitAndStartAnalogInputSequence. When you get this interrupt, you have to read the data measured by the board by calling the function l_PCIe3521_ReadSequenceData (see its own documentation). If your computer is too slow to handle all the data, after a while you will have an internal data fifo overflow (dw_InterruptMask will be 0x4). You can change the size of the internal data fifo in the driver's configuration pages.
  • 0x8: End of DMA acquisition. You will receive this interrupt when using i_PCIe3521_InitAndStartAnalogInputSequence in non continuous mode
  • 0x10: PLD FIFO overflow. The board is too slow to handle all the data
Parameters
[in]h_DeviceHandle: Handle of the board
[in]v_FunctionName: Address of the callback function
h_DeviceHandle : Handle of the board
b_FIFOOverflow : If uc_FIFOOverflow != 0, there are too many untreated interrupts in the kernel FIFO, and any new information is lost
dw_InterruptSource : Source of the interrupt
dw_InterruptMask : Source of the interrupt
pw_Args : Values read during the interrupt. If DMA interrupt, this pointer will be set to NULL.
dw_ArgsCount : Number of values read during the interrupt
Returns
0 : No Error -1 : The device handle parameter is wrong
-2 : An interrupt routine was still isntalled. Remove it with i_PCIe3521_ResetBoardIntRoutine and retry
-3 : Error while creating kill event
-4 : Error while creating interrupt event
-5 : Error while creating interrupt thread
-6 : Error while changing the priority class of the thread
-7 : Error while changing the priority of the thread
-8 : Error while calling the IOCTL command
-9 : Error in the interrupt callback function
_INT_ i_PCIe3521_ResetBoardIntRoutine ( HANDLE  h_DeviceHandle)

Deinstall the interrupt callback function.

Parameters
[in]h_DeviceHandle: Handle of the board
Returns
0 : No Error -1 : The device handle parameter is wrong
-2 : No interrupt routine installed
-3 : Error in the reset interrupt callback function