APCIE-3660 API  1719
Analog input functions

Functions

int i_APCIE3660_SetUserCalibrationValue (uint8_t boardId, uint8_t moduleIndex, uint32_t calibrationGain, uint32_t calibrationOffset)
 
int i_APCIE3660_SetCalibrationValues (uint8_t boardId, uint8_t moduleMask, uint8_t gainValues)
 
int i_APCIE3660_InitAnalogInputModule (uint8_t boardId, uint8_t moduleIndex, uint8_t singleDiffMode, uint8_t coupling, uint8_t enableCurrentSource, uint8_t gainSelection, uint8_t dataRate)
 
int i_APCIE3660_Read1AnalogInputModule (uint8_t boardId, uint8_t moduleIndex, uint32_t *value)
 
int i_APCIE3660_ReleaseAnalogInputModule (uint8_t boardId, uint8_t moduleIndex)
 
int i_APCIE3660_InitAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleIndex, uint8_t mode, uint32_t onBoardBufferSize, uint32_t compareValue)
 
int i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleIndex)
 
int i_APCIE3660_StartAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleIndex)
 
int i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleMask)
 
int i_APCIE3660_StopAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleIndex)
 
int i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition (uint8_t boardId, uint8_t moduleIndex)
 

Detailed Description

Function Documentation

◆ i_APCIE3660_SetUserCalibrationValue()

int i_APCIE3660_SetUserCalibrationValue ( uint8_t  boardId,
uint8_t  moduleIndex,
uint32_t  calibrationGain,
uint32_t  calibrationOffset 
)

Sets the calibration value

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
[in]calibrationGainGain value determine by calibration for each channel (calibration values are stored in file apcie3660_calibration.conf is stored in /etc/APCIE3660)
[in]calibrationOffsetGain value determine by calibration for each channel (calibration file apcie3660_calibration.conf is stored in /etc/APCIE3660)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex parameter is wrong
-3Error with calibration selection
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_SetCalibrationValues()

int i_APCIE3660_SetCalibrationValues ( uint8_t  boardId,
uint8_t  moduleMask,
uint8_t  gainValues 
)

Sets the calibration value (calibration values are loaded from file apcie3660_calibration.conf in /etc/APCIE3660).
Structure of file apcie3660_calibration.conf :

  • Line 1 : module 0 -> gain 1 -> gain value
  • Line 2 : module 0 -> gain 1 -> offset value
  • Line 3 : module 0 -> gain 10 -> gain value
  • Line 4 : module 0 -> gain 10 -> offset value
  • Line 5 : module 1 -> gain 1 -> gain value
  • Line 6 : module 1 -> gain 1 -> offset value
  • Line 7 : module 1 -> gain 10 -> gain value
  • ...
  • Line 16 : module 3 -> gain 10 -> offset value
Parameters
[in]boardIdTarget board index
[in]moduleMaskMask of the analog input module to configure (0 to 15)
[in]gainValuesgain value of the analog input module to configure (0 to 15)(bit 0 : gain Module 0 ...)
Return values
0No error
-1The boardId is wrong
-2The moduleMask parameter is wrong
-3The gainMask parameter is wrong
-4The gainMask parameter is wrong
-13Error with calibration selection module 0 (error from SetUserCalibrationValue)
-14Error with calibration selection module 1 (error from SetUserCalibrationValue)
-15Error with calibration selection module 2 (error from SetUserCalibrationValue)
-16Error with calibration selection module 3 (error from SetUserCalibrationValue)
-24An error occurred while calling the IOCTL function

◆ i_APCIE3660_InitAnalogInputModule()

int i_APCIE3660_InitAnalogInputModule ( uint8_t  boardId,
uint8_t  moduleIndex,
uint8_t  singleDiffMode,
uint8_t  coupling,
uint8_t  enableCurrentSource,
uint8_t  gainSelection,
uint8_t  dataRate 
)

Initializes the analog input module moduleIndex

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
[in]singleDiffModeSingle-Ended / Differential mode of each channel
  • 0 : Single ended
  • 1 : Differential
[in]couplingCoupling mode (AC / DC) of each channels
  • 0 : DC
  • 1 : AC
[in]enableCurrentSourceEnable / Disable the current source for each channel
  • 0 : Disabled
  • 1 : Enabled
[in]gainSelectionGain selection
  • 0 : Gain 1
  • 1 : Gain 10
[in]dataRateAcquisition frequency, depends on digitalFilter and filterPath parameter:
  • 0 : 125 kSps, Bandwidth 59.375 kHz
  • 1 : 250 kSps, Bandwidth 118.75 kHz
  • 2 : 500 kSps, Bandwidth 237.5 kHz
  • 3 : 1000 kSps, Bandwidth 475 kHz
  • 4 : 2000 kSps, Bandwidth 950 kHz
  • 5 : 4000 kSps, Bandwidth 1900 kHz
Return values
0No error
-1The boardId is wrong
-2The b_ModuleIndex parameter is wrong
-3Module is already initialized.
-4Wrong Single/Diff Mode selection
-5Wrong coupling selection
-6Wrong gain selection
-7Wrong Current source flag
-8When the current source is used, the configuration of the channel must be Single-Ended and AC
-9Wrong filterPath parameter
-10Wrong digitalFilter parameter
-11Wrong dataRate parameter
-12Wrong dataRate parameter due to filterPath and digitalFilter configuration
-13Wrong filterPath and digitalFilter configuration, both parameter cannot be 0
-14An error occurred while calling the IOCTL function
Sampling frequency(in MHz)
Data Rate Sampling frequency
0 0.125
1 0.250
2 0.5
3 1
4 2
5 4

◆ i_APCIE3660_Read1AnalogInputModule()

int i_APCIE3660_Read1AnalogInputModule ( uint8_t  boardId,
uint8_t  moduleIndex,
uint32_t *  value 
)

Read one analog input module

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
[out]valueValue of the analog input channel
Return values
0No error
-1The boardId is wrong
-2The ModuleIndex parameter is wrong
-3Module is not initialized.
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_ReleaseAnalogInputModule()

int i_APCIE3660_ReleaseAnalogInputModule ( uint8_t  boardId,
uint8_t  moduleIndex 
)

Release the analog input module moduleIndex

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex is wrong
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_InitAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_InitAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleIndex,
uint8_t  mode,
uint32_t  onBoardBufferSize,
uint32_t  compareValue 
)

Init analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
[in]modeIn both modes, when the compare value is reached, an interrupt occurs to read the value from the buffer.
  • 0: Auto stop mode, the board buffer is filled with value. When the board buffer is full, the acquisition is stopped and an interrupt occurs.
  • 1: Ring buffer mode, the board buffer is always filled with values. To stop the acquistion, the i_APCIE3660_StopAnalogInputModuleCyclicAcquisition must be called.
[in]onBoardBufferSizeBoard buffer size, the size of this buffer is 1024 * (2^dw_OnBoardBufferSize).
[in]compareValueDefine the number of acquisition to have in the board buffer to generate an interrupt to start the DMA transfer (must be < (1024 * (2^dw_OnBoardBufferSize)).
Return values
0No error
-1The boardId is wrong
-2The moduleIndex parameter is wrong
-3Wrong mode selection
-4The module is not initialized
-5The compare value parameter is wrong, must be < (2^dw_OnBoardBufferSize) * 1024)
-6The cyclic acquisition is already initialized
-7Not enough place in the on board RAM
-8The onBoardBufferSize parameter is wrong (bigger than the board RAM size)
-9The calibration is running on the module
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleIndex 
)

Trigger analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex is wrong
-3The cyclic acquisition is initialized
-4The cyclic acquisition is already started
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_StartAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_StartAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleIndex 
)

Start analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex is wrong
-3The cyclic acquisition has not been initialized
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleMask 
)

Start analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleMaskmask of the index of the analog input module(s) to start (0 to 15)(0x0 to 0xF: 0x1 = module1, 0x2 = module2, 0x3 = module1 and module2,...)
Return values
0No error
-2The moduleIndex parameter is wrong
-3The cyclic acquisition is not initialized or not by this process
-4An acquisition is already started on one of the module in mask
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_StopAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_StopAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleIndex 
)

Stop analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex is wrong
-14An error occurred while calling the IOCTL function

◆ i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition()

int i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition ( uint8_t  boardId,
uint8_t  moduleIndex 
)

Release analog input module cyclic acquisition

Parameters
[in]boardIdTarget board index
[in]moduleIndexIndex of the analog input module to release (0 to 3)
Return values
0No error
-1The boardId is wrong
-2The moduleIndex is wrong
-14An error occurred while calling the IOCTL function