xPCI-3120 API
APCI-3120 interrupt management functions

Functions

_INT_ i_APCI3120_SetBoardIntRoutineWin32 (BYTE_ b_BoardHandle, BYTE_ b_UserCallingMode, ULONG_ ul_GlobalBufferSize, VOID **ppv_UserGlobalBuffer, void(far pascal *v_FunctionName)(BYTE_ b_BoardHandle, BYTE_ b_InterruptMask, PDWORD pui_AnalogInputValue, BYTE_ b_UserCallingMode, VOID *pv_UserSharedMemory))
 
_INT_ i_APCI3120_ResetBoardIntRoutine (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_TestInterrupt (PBYTE_ pb_BoardHandle, PBYTE_ pb_InterruptMask, PDWORD pui_AnalogInputValue)
 

Detailed Description

Function Documentation

◆ i_APCI3120_SetBoardIntRoutineWin32()

_INT_ i_APCI3120_SetBoardIntRoutineWin32 ( BYTE_  b_BoardHandle,
BYTE_  b_UserCallingMode,
ULONG_  ul_GlobalBufferSize,
VOID **  ppv_UserGlobalBuffer,
void(far pascal *v_FunctionName)(BYTE_ b_BoardHandle, BYTE_ b_InterruptMask, PDWORD pui_AnalogInputValue, BYTE_ b_UserCallingMode, VOID *pv_UserSharedMemory)   
)

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

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_UserCallingMode: Interrupt calling mode, synchronous mode not available, this parameter must be 0.
[in]ul_GlobalBufferSize: User shared memory size.
[in]ppv_UserGlobalBuffer: User shared memory.
[in]v_FunctionName: Address of the callback function
b_BoardHandle : Handle of the board
b_InterruptMask : Source of the interrupt
b_InputChannelNbr : Values of the input
b_UserCallingMode : Parameter not used
pv_UserSharedMemory : Parameter not used

The mask of the interrupt

  • 0x1: End of Conversion (EOC)
  • 0x2: Conversion driven by timer is completed
  • 0x4: Conversion of a group of channels is completed (EOS)
  • 0x8: DMA conversion cycle is completed
  • 0x10: Timer 2 has run down
  • 0x20: Analog output channels - Watchdog has run down
Return values
0: No Error
-1: The device handle parameter is wrong
-2: An interrupt routine was still installed. Remove it with i_APCI3120_ResetBoardIntRoutine and retry
-3: User interrupt routine calling mode selection wrong (synchronous mode is not available)
-103: Error while creating kill event
-104: Error while creating interrupt event
-105: Error while creating interrupt thread
-106: Error while changing the priority class of the thread
-107: Error while changing the priority of the thread
-108: Error while calling the IOCTL command
-109: Error in the interrupt callback function

◆ i_APCI3120_ResetBoardIntRoutine()

_INT_ i_APCI3120_ResetBoardIntRoutine ( BYTE_  b_BoardHandle)

Remove the interrupt callback function.

Parameters
[in]b_BoardHandle: Handle of the board
Return values
0: No Error
-1: The device handle parameter is wrong
-2: No interrupt routine installed
-103: Error in the reset interrupt callback function

◆ i_APCI3120_TestInterrupt()

_INT_ i_APCI3120_TestInterrupt ( PBYTE_  pb_BoardHandle,
PBYTE_  pb_InterruptMask,
PDWORD  pui_AnalogInputValue 
)

This function tests if the APCI3120 has generated an interrupt. If yes, the function returns the handle of the board and the interrupt source.

Parameters
[in]pb_BoardHandle: Handle of the board
[in]pb_InterruptMask: interrupt mask
[in]pui_AnalogInputValueinterrupt channel number
Return values
0: No Interrupt
>0: Interrupt line