APCIE-3660 API  1719
Analog input functions

Functions

uint8_t i_APCIE3660_SetCalibrationValue (PDEVICE_DATA deviceData, uint8_t moduleIndex, uint8_t calibrationSelection, uint32_t calibrationValue)
 
uint8_t i_APCIE3660_InitAnalogInputModule (PDEVICE_DATA deviceData, uint8_t moduleIndex, uint8_t singleDiffMode, uint8_t coupling, uint8_t enableCurrentSource, uint8_t gainSelection, uint8_t digitalFilter, uint8_t filterPath, uint8_t dataRate, uint8_t calibrationMode)
 
uint8_t i_APCIE3660_Read1AnalogInputModule (PDEVICE_DATA deviceData, uint8_t moduleIndex, uint32_t *value)
 
uint8_t i_APCIE3660_ReleaseAnalogInputModule (PDEVICE_DATA deviceData, uint8_t moduleIndex)
 
uint8_t i_APCIE3660_InitAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleIndex, uint8_t mode, uint32_t onBoardBufferSize, uint32_t compareValue)
 
uint8_t i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleIndex)
 
uint8_t i_APCIE3660_StartAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleIndex)
 
uint8_t i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleMask)
 
uint8_t i_APCIE3660_StopAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleIndex)
 
uint8_t i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition (PDEVICE_DATA deviceData, uint8_t moduleIndex)
 

Detailed Description

Function Documentation

◆ i_APCIE3660_SetCalibrationValue()

uint8_t i_APCIE3660_SetCalibrationValue ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex,
uint8_t  calibrationSelection,
uint32_t  calibrationValue 
)

Sets the calibration value

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
[in]calibrationSelectionSelect either Gain or Offset ( 0 = GAIN; 1 = OFFSET)
[in]calibrationValuecalibration value to set coded on 12 bits (0 - 4095)(calibration file apcie3660_calibration.conf is stored in /etc/APCIE3660)
Return values
0No error
2The b_ModuleIndex parameter is wrong
3Error with calibration selection

◆ i_APCIE3660_InitAnalogInputModule()

uint8_t i_APCIE3660_InitAnalogInputModule ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex,
uint8_t  singleDiffMode,
uint8_t  coupling,
uint8_t  enableCurrentSource,
uint8_t  gainSelection,
uint8_t  digitalFilter,
uint8_t  filterPath,
uint8_t  dataRate,
uint8_t  calibrationMode 
)

Initialize the analog input module moduleIndex

Parameters
[in]deviceDataHandle of the board
[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]digitalFilter
  • 0 : Single-cycle setting
  • 1 : Fast Response
[in]filterPath
  • 0 : Wide-Bandwidth
  • 1 : Low-Latency
[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
[in]calibrationMode
  • 0 : Disabled
  • 1 : Enabled
Return values
0No error
2The 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
14The module power supply could not be turned on

◆ i_APCIE3660_Read1AnalogInputModule()

uint8_t i_APCIE3660_Read1AnalogInputModule ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex,
uint32_t *  value 
)

Read one analog input module

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
[out]valuevalue of the analog input channel
Return values
0No error
2The moduleIndex parameter is wrong
3Module is already initialized.

◆ i_APCIE3660_ReleaseAnalogInputModule()

uint8_t i_APCIE3660_ReleaseAnalogInputModule ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex 
)

Release the analog input module moduleIndex

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
-1The deviceData parameter is wrong
-2The moduleIndex parameter is wrong

◆ i_APCIE3660_InitAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_InitAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex,
uint8_t  mode,
uint32_t  onBoardBufferSize,
uint32_t  compareValue 
)

To-Do Write doxygen fucntion description Init analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[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
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

◆ i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_TriggerAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex 
)

Trigger analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
2The moduleIndex parameter is wrong
3The cyclic acquisition is not initialized
4The cyclic acquisition is already started

◆ i_APCIE3660_StartAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_StartAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex 
)

Start analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
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 this channel

◆ i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_StartMultipleAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleMask 
)

Start analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[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 this channel

◆ i_APCIE3660_StopAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_StopAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex 
)

To-Do Write doxygen fucntion description Stop analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexModule to stop
Return values
0No error
2The moduleIndex parameter is wrong

◆ i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition()

uint8_t i_APCIE3660_ReleaseAnalogInputModuleCyclicAcquisition ( PDEVICE_DATA  deviceData,
uint8_t  moduleIndex 
)

Release analog input module cyclic acquisition

Parameters
[in]deviceDataHandle of the board
[in]moduleIndexIndex of the analog input module (0 to 3)
Return values
0No error
2The moduleIndex parameter is wrong