xPCI-3001 API
APCI-3001 DLL ADDI-DATA W32-Bit Driver for x86 General functions

Functions

_INT_ i_PCI3001_InitCompiler (BYTE_ b_CompilerDefine)
 
_INT_ i_PCI3001_CheckAndGetPCISlotNumber (PBYTE_ pb_SlotNumberArray)
 
_INT_ i_PCI3001_SetBoardInformation (BYTE_ b_SlotNumber, BYTE_ b_AnalogInputChannelNbr, PBYTE_ pb_BoardHandle)
 
_INT_ i_PCI3001_GetHardwareInformation (BYTE_ b_Boardhandle, PUINT_ pui_BaseAddress, PBYTE_ pb_InterruptNbr, PBYTE_ pb_SlotNumber)
 
_INT_ i_PCI3001_SetBoardIntRoutineWin32 (BYTE_ b_BoardHandle, BYTE_ b_UserCallingMode, ULONG_ ul_GlobalBufferSize, VOID **ppv_UserGlobalBuffer, void(far pascal *v_FunctionName)(BYTE_b_BoardHandle, BYTE_b_InterruptMask, PUINT_ pui_AnalogInputValue, BYTE_b_UserCallingMode, VOID *pv_UserSharedMemory))
 
_INT_ i_PCI3001_ResetBoardIntRoutine (BYTE_ b_BoardHandle)
 
_INT_ i_PCI3001_CloseBoardHandle (BYTE_ b_BoardHandle)
 

Detailed Description

Function Documentation

_INT_ i_PCI3001_InitCompiler ( BYTE_  b_CompilerDefine)

This function is only available in a windows environment

Parameters
[in]b_CompilerDefine: Program Language selection.
Returns
0 : no error
_INT_ i_PCI3001_CheckAndGetPCISlotNumber ( PBYTE_  pb_SlotNumberArray)

Check all PCI-3001 and return the slot number of each PCI-3001 board.
Each pb_SlotNumberArray member contain the slot
number (1 to 8) from 1 PCI-3001 Board.

Parameters
[in]pb_SlotNumberArray: Slot number list.
Returns
0 : No board found
>0 : Number of boards found
-1 : Driver Load error
-100 : Failed to load library
-101 : Failed to get i_PCI3001_GetDLLVersion function from library
-102 : Failed to get i_PCI3001_GetBoardInformation function from library
-103 : Failed to get i_PCI3001_GetNumberOfBoards function from library
-104 : Wrong DLL version, check that the DLL used come from the same version than the driver
-105 : Failed getting number of boards
-106 : Failed getting board informations
_INT_ i_PCI3001_SetBoardInformation ( BYTE_  b_SlotNumber,
BYTE_  b_AnalogInputChannelNbr,
PBYTE_  pb_BoardHandle 
)

Open board with slot number.

Parameters
[in]b_SlotNumber: Index of the board to open
[in]b_AnalogInputChannelNbr: Not used must be 0
[out]pb_BoardHandle: Handle of the selected xPCI-3001 board for using the functions
Returns
0 : No error
-1 : Driver load error
-100 : Failed to get i_PCI3001_OpenBoardViaIndex function
-101 : Unable to get the number of available boards
-103 : Error while getting the device's class
-104 : Error while getting informations about the device
-105 : Memory allocation error
-106 : Get device interface detail error
-107 : Error while creating communication handle
-108 : Error in the initialization callback function
-109 : Input Mode is not setted in the device manager
_INT_ i_PCI3001_GetHardwareInformation ( BYTE_  b_Boardhandle,
PUINT_  pui_BaseAddress,
PBYTE_  pb_InterruptNbr,
PBYTE_  pb_SlotNumber 
)

Get device information of the board.

Parameters
[in]b_Boardhandle: Index of the board
[out]pui_BaseAddress: Base address of the board
[out]pb_InterruptNbr: Interrupt line of the board
[out]pb_SlotNumber: Slot number.
Returns
0 : No error
-1 : Wrong device handle
_INT_ i_PCI3001_SetBoardIntRoutineWin32 ( BYTE_  b_BoardHandle,
BYTE_  b_UserCallingMode,
ULONG_  ul_GlobalBufferSize,
VOID **  ppv_UserGlobalBuffer,
void(far pascal *v_FunctionName)(BYTE_b_BoardHandle, BYTE_b_InterruptMask, PUINT_ 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.
[in]ul_GlobalBufferSize: User shared memory size.
[in]ppv_UserGlobalBufferUser shared memory.
[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_InterruptMask : Source of the interrupt
pui_AnalogInputValue : Values of the selected inputs (index 0 is the number of acquisitions)
pv_UserSharedMemory : Not used

The source of the interrupt can be:

  • 0x1: Analog interrupt without DMA
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : An interrupt routine was still isntalled. Remove it with i_APCI3001_ResetBoardIntRoutine and retry
-3 : User interrupt routine calling mode selection wrong (synchrone mode is not available)
-100 : Failed to get i_PCI3001_SetBoardIntRoutine function from DLL
-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
-110 : ul_GlobalBufferSize is greater than 0 and ppv_UserGlobalBuffer is NULL
_INT_ i_PCI3001_ResetBoardIntRoutine ( BYTE_  b_BoardHandle)

Deinstall the interrupt callback function.

Parameters
[in]b_BoardHandle: Handle of the board
Returns
0 : No Error
-1 : The device handle parameter is wrong
-2 : No interrupt routine installed
-100 : Failed to get i_PCI3001_ResetBoardIntRoutine function from DLL
-103 : Error in the reset interrupt callback function
_INT_ i_PCI3001_CloseBoardHandle ( BYTE_  b_BoardHandle)

Release the handle of the board. Block the access to the board.

Parameters
[in]b_BoardHandle: Handle of the board
Returns
0 : No Error
-1 : The device handle parameter is wrong