xPCI-3120 API
xPCI-3120 interrupt management functions

Functions

_INT_ i_PCI3120_SetBoardIntRoutine (HANDLE h_DeviceHandle, void(*v_FunctionName)(HANDLE h_DeviceHandle, BYTE b_FIFOOverflow, BYTE b_InterruptMask, PWORD pw_Args, DWORD dw_ArgsCount))
 
_INT_ i_PCI3120_ResetBoardIntRoutine (HANDLE h_DeviceHandle)
 

Detailed Description

Function Documentation

◆ i_PCI3120_SetBoardIntRoutine()

_INT_ i_PCI3120_SetBoardIntRoutine ( HANDLE  h_DeviceHandle,
void(*)(HANDLE h_DeviceHandle, BYTE b_FIFOOverflow, BYTE b_InterruptMask, PWORD pw_Args, DWORD dw_ArgsCount)  v_FunctionName 
)

Install an interrupt callback function.
The interrupt callback is called after each hardware interrupt, and can access and process the data read during the interrupt The value of b_InterruptMask will enable you to determine the source of the interruption:

  • 0x1: End of sequence when calling i_PCI3120_Read1AnalogInput or i_PCI3120_ReadMoreAnalogInputs. Value are available thanks to pw_Args.
  • 0x4: Internal FIFO overflow. 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: DMA interrupt. You will receive this interrupt when using i_PCI3120_InitAndStartAnalogInputSequence. When you get this interrupt, you have to read the data measured by the board by calling the function i_PCI3120_ReadSequenceData (see its own documentation).
  • 0x10: Timer interrupt.
  • 0x20: Watchdog interrupt.
Parameters
[in]h_DeviceHandleHandle of the board
[in]v_FunctionNameAddress of the callback function
  • h_DeviceHandle : Handle of the board
  • b_FIFOOverflow : Indicates the status of the kernel interrupt FIFO (0 : no overflow, 1 : overflow, loss of data)
  • b_InterruptMask : Indicates the event that generated this interrupt
  • pw_Args : Values read during the interrupt
  • 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_PCI3120_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
-65535 : Error function doesn't exist in the DLL (if PCIe3121 DLL wrapper is used)

◆ i_PCI3120_ResetBoardIntRoutine()

_INT_ i_PCI3120_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
-65535 : Error function doesn't exist in the DLL (if PCIe3121 DLL wrapper is used)