xPCI-3120 API

Functions

_INT_ i_APCI3120_Read1AnalogInput (BYTE_ b_BoardHandle, BYTE_ b_Channel, BYTE_ b_Gain, BYTE_ b_Polarity, UINT_ ui_ConvertTiming, BYTE_ b_InterruptFlag, PUINT_ pui_AnalogInputValue)
 
_INT_ i_APCI3120_ReadMoreAnalogInput (BYTE_ b_BoardHandle, BYTE_ b_SequenzArraySize, PBYTE_ pb_ChannelArray, PBYTE_ pb_GainArray, PBYTE_ pb_PolarityArray, UINT_ ui_ConvertTiming, BYTE_ b_InterruptFlag, PUINT_ pui_AnalogInputValueArray)
 
_INT_ i_APCI3120_InitAnalogInputAcquisition (BYTE_ b_BoardHandle, BYTE_ b_SequenzArraySize, unsigned char *pb_ChannelArray, unsigned char *pb_GainArray, unsigned char *pb_PolarityArray, BYTE_ b_AcquisitionMode, BYTE_ b_ExternTrigger, UINT_ ui_AcquisitionTiming, LONG_ l_DelayTiming, ULONG_ ul_NumberOfAcquisition, BYTE_ b_DMAMode, BYTE_ b_AcquisitionCycle)
 
_INT_ i_APCI3120_StartAnalogInputAcquisition (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_StopAnalogInputAcquisition (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_ClearAnalogInputAcquisition (BYTE_ b_BoardHandle)
 
_INT_ i_APCI3120_GetPCIDMABufferAddress (BYTE_ b_BoardHandle, PUINT_ *ppui_Buffer0Address, PUINT_ *ppui_Buffer1Address)
 
_INT_ i_APCI3120_GetDMATransferStatus (BYTE b_BoardHandle, DWORD *pdw_Number, BYTE *pb_DMABufferIndex)
 
_INT_ i_APCI3120_Write1AnalogValue (BYTE_ b_BoardHandle, BYTE_ b_ChannelNbr, BYTE_ b_Polarity, UINT_ ui_ValueToWrite)
 
_INT_ i_APCI3120_WriteMoreAnalogValue (BYTE_ b_BoardHandle, BYTE_ b_FirstChannelNbr, BYTE_ b_NbrOfChannel, PBYTE_ pb_PolarityArray, PUINT_ pui_WriteValueArray)
 

Detailed Description

Function Documentation

◆ i_APCI3120_Read1AnalogInput()

_INT_ i_APCI3120_Read1AnalogInput ( BYTE_  b_BoardHandle,
BYTE_  b_Channel,
BYTE_  b_Gain,
BYTE_  b_Polarity,
UINT_  ui_ConvertTiming,
BYTE_  b_InterruptFlag,
PUINT_  pui_AnalogInputValue 
)

Reads the current value of the analog input b_Channel with a gain b_Gain, an input voltage range of b_Polarity and a conversion time of ui_ConvertTiming

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_Channel: Channel to read (Single-ended : 0 to 15, differential : 0-7)
[in]b_Gain: Gain to set -> APCI3120_1_GAIN (1), APCI3120_2_GAIN (2), APCI3120_5_GAIN (5), APCI3120_10_GAIN (10)
[in]b_Polarity: Polarity to set -> APCI3120_UNIPOLAR (0-10V), APCI3120_BIPOLAR (-10-10V)
[in]ui_ConvertTiming: Selection of the conversion time, from 10 to 45874us
[in]b_InterruptFlag: Whether an interrupt is generated at EOS (End Of Sequence) or not
[out]pui_AnalogInputValue: The raw analog value (0x0000 to 0xFFFF)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: Number of the analog input is wrong
-3: The selected gain is wrong
-4: The selected input voltage range is wrong
-5: The selected conversion time is wrong
-6: A wrong parameter has been passed for b_InterruptFlag or the user interrupt routine has not been installed
-103: The input mode has not been set
-110: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_ReadMoreAnalogInput()

_INT_ i_APCI3120_ReadMoreAnalogInput ( BYTE_  b_BoardHandle,
BYTE_  b_SequenzArraySize,
PBYTE_  pb_ChannelArray,
PBYTE_  pb_GainArray,
PBYTE_  pb_PolarityArray,
UINT_  ui_ConvertTiming,
BYTE_  b_InterruptFlag,
PUINT_  pui_AnalogInputValueArray 
)

Reads several analog input channels
The priority of the analog input channels is set with the scan list
The scan list allows to determine the input voltage range and the gain for each analog input channel
The gain is defined with parameter pb_Gain for each analog input channel
The input voltage range is defined with parameter pb_Polarity for each analog input channel

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_SequenzArraySize: Size of the sequence tables
[in]pb_ChannelArray: Channel selection array
[in]pb_GainArray: Gain selection array
[in]pb_PolarityArray: Selection of the input voltage range of the analog input to convert
[in]ui_ConvertTiming: Selection of the conversion time from 10 to 45874us
[in]b_InterruptFlag: Whether an interrupt is generated at EOS (End Of Sequence) or not
[out]pui_AnalogInputValueArray: pui_AnalogInputValueArray Raw output values (0x0 to 0xFFFF)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: Number of the analog input is wrong
-3: The selected gain is wrong
-4: The selected input voltage range is wrong
-5: The selected conversion time is wrong
-6: A wrong parameter has been passed for b_InterruptFlag or the user interrupt routine has not been installed
-103: The input mode has not been set
-110: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_InitAnalogInputAcquisition()

_INT_ i_APCI3120_InitAnalogInputAcquisition ( BYTE_  b_BoardHandle,
BYTE_  b_SequenzArraySize,
unsigned char *  pb_ChannelArray,
unsigned char *  pb_GainArray,
unsigned char *  pb_PolarityArray,
BYTE_  b_AcquisitionMode,
BYTE_  b_ExternTrigger,
UINT_  ui_AcquisitionTiming,
LONG_  l_DelayTiming,
ULONG_  ul_NumberOfAcquisition,
BYTE_  b_DMAMode,
BYTE_  b_AcquisitionCycle 
)

This function initializes a cyclic conversion.

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_SequenzArraySize: Size of the sequence tables (1 to 16 elements)
[in]pb_ChannelArray: Sequence table of the analog inputs.
[in]pb_GainArray: Sequence table of gain.
[in]pb_PolarityArray: Sequence table of the input voltage range.
[in]b_AcquisitionMode: Two conversion cycles are possible
  • APCI3120_SIMPLE_MODUS: A conversion occurs every ui_AcquisitionTiming (time interval)
  • APCI3120_DELAY_MODUS: The both times are used in this mode ui_AcquisitionTiming and l_DelayTiming.
[in]b_ExternTrigger: External trigger
  • APCI3120_ENABLE: external trigger enabled
  • APCI3120_DISABLE: external trigger disabled
[in]ui_AcquisitionTiming: Time interval in us between 2 conversions of successive input channels (from 10 us to 32767 us).
[in]l_DelayTiming: Waiting time between two conversion cycles (70s to 4587400s), only in APCI3120_DELAY_MODUS
[in]ul_NumberOfAcquisition: Conversion number (ul_NumberOfAcquisition * sequence size must be multiple of 2)
[in]b_DMAMode: Determines if DMA must be used or not.
  • APCI3120_DMA_USED : All the conversion values are saved and returned to the user. An interrupt is generated when the conversions (set by ui_NumberOfAcquisition) are completed.
  • APCI3120_DMA_NOT_USED : An interrupt is generated at the end of each conversion and the analog value is returned to the user through the interrupt routine.
[in]b_AcquisitionCycle: Determines the type of DMA conversion.
  • APCI3120_CONTINUOUS : An interrupt is generated each time a DMA conversion cycle is completed .A new DMA conversion cycle is started.
  • APCI3120_SINGLE : The DMA conversion cycle is only carried out once: i.e. you receive one single interrupt at the end of the first DMA conversion cycle.
Return values
-1: The handle parameter of the board is wrong
-3: The size of the sequence table is wrong
-5: Wrong parameter found in table pb_GainArray
-6: Wrong parameter found in table pb_PolarityArray
-5: ul_NumberOfAcquisition is wrong
-100: Failed to allocate DMA buffers (increase DMA buffer size in device manager/Configuration Tab), formula is :
  • APCI3120_DMA_NOT_USED : b_SequenzArraySize
  • APCI3120_DMA_USED : b_SequenzArraySize * ul_NumberOfAcquisition

◆ i_APCI3120_StartAnalogInputAcquisition()

_INT_ i_APCI3120_StartAnalogInputAcquisition ( BYTE_  b_BoardHandle)

Starts the cyclic conversion. It has been previously initialized with function

Parameters
[in]b_BoardHandle: Handle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The cyclic conversion has not been initialized.
-3: Interrupt routine has not been installed
-102: The size of the sequence table is wrong
-103: The input mode is wrong
-104: Wrong parameter found in table pb_ChannelArray
-105: Wrong parameter found in table pb_GainArray
-106: Wrong parameter found in table pb_PolarityArray
-107: The parameter b_AcquisitionCycle is wrong
-108: The parameter l_DelayTiming is wrong
-109: The selected time for ui_AcquisitionTiming or l_DelayTiming is wrong
-110: l_DelayTiming is not a multiple of 50
-111: l_DelayTiming is not a multiple of 50
-112: dw_DelayTime is smaller than (b_ChannelCount * w_ConvertingTime)
-116: Extern Trigger is wrong
-117: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_StopAnalogInputAcquisition()

_INT_ i_APCI3120_StopAnalogInputAcquisition ( BYTE_  b_BoardHandle)

Stops the cyclic conversion . It has been started previously with function i_APCI3120_StartAnalogInputAcquisition

Parameters
[in]b_BoardHandle: Handle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The cyclic conversion has not been started.

◆ i_APCI3120_ClearAnalogInputAcquisition()

_INT_ i_APCI3120_ClearAnalogInputAcquisition ( BYTE_  b_BoardHandle)

Deinstalls the DMA buffer

Parameters
[in]b_BoardHandle: Handle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The cyclic conversion has not been initialized.

◆ i_APCI3120_GetPCIDMABufferAddress()

_INT_ i_APCI3120_GetPCIDMABufferAddress ( BYTE_  b_BoardHandle,
PUINT_ *  ppui_Buffer0Address,
PUINT_ *  ppui_Buffer1Address 
)

Get the Ring 3 PCI DMA buffer address

Parameters
[in]b_BoardHandle: Handle of the board
[out]ppui_Buffer0Address: Buffer 0 address
[out]ppui_Buffer1Address: Buffer 1 address
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The cyclic conversion has not been initialized
-3: DMA not used

◆ i_APCI3120_GetDMATransferStatus()

_INT_ i_APCI3120_GetDMATransferStatus ( BYTE  b_BoardHandle,
DWORD *  pdw_Number,
BYTE *  pb_DMABufferIndex 
)

Return the number of DMA transfer that occur for the currently DMA buffer

Parameters
[in]b_BoardHandle: Handle of the board
[out]pdw_Number: Number of DMA transfer that occurs
[out]pb_DMABufferIndex: Return the currently DMA buffer index
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The cyclic conversion has not been initialized
-3: DMA not used

◆ i_APCI3120_Write1AnalogValue()

_INT_ i_APCI3120_Write1AnalogValue ( BYTE_  b_BoardHandle,
BYTE_  b_ChannelNbr,
BYTE_  b_Polarity,
UINT_  ui_ValueToWrite 
)

Writes one analog value directly on analog output channel

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_ChannelNbr: Index of the analog output channel (0 to 7)
[in]b_Polarity: Selection of the input voltage range APCI3120_UNIPOLAR or APCI3120_BIPOLAR
[in]ui_ValueToWrite: Value to write to the output
  • Unipolar: 0x0000 to 0x1FFF ( 0V to 10V)
  • Bipolar : 0x0000 to 0x3FFF (-10V to 10V)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: Wrong output channel number
-3: Wrong polarity selection for the output channel
-4: Wrong analog output value
-107: Error while calling IOCTL function (wrong handle ?)

◆ i_APCI3120_WriteMoreAnalogValue()

_INT_ i_APCI3120_WriteMoreAnalogValue ( BYTE_  b_BoardHandle,
BYTE_  b_FirstChannelNbr,
BYTE_  b_NbrOfChannel,
PBYTE_  pb_PolarityArray,
PUINT_  pui_WriteValueArray 
)

Writes one analog value directly on analog output channel

Parameters
[in]b_BoardHandle: Handle of the board
[in]b_FirstChannelNbr: Number of the first analog output (0 to 7)
[in]b_NbrOfChannel: Number of analog outputs you wish to write on
[in]pb_PolarityArray: Polarity array
[in]pui_WriteValueArray: Table of values to write to the outputs
  • Unipolar: 0x0000 to 0x1FFF ( 0V to 10V)
  • Bipolar : 0x0000 to 0x3FFF (-10V to 10V)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The number of the first analog output is wrong See function i_APCI3120_SetBoardInformation
-3: The number of analog outputs you wish to write on is wrong See function i_APCI3120_SetBoardInformation
-4: One or several polarity selections are wrong
-5: One or several output values are too high (max. 8192 unipolar / 16383 bipolar)
-107: Error while calling IOCTL function (wrong handle ?)