APCI-3660 API  1719
xPCI3660 Incremental counter functions

Functions

int i_APCI3660_SetIncChronoMode (uint8_t boardId, uint32_t dw_Mode)
 
int i_APCI3660_GetIncChronoMode (uint8_t boardId, uint32_t *pdw_Mode)
 
int i_APCI3660_InitIncCounter (uint8_t boardId, uint32_t dw_Counter, uint32_t dw_Index, uint32_t dw_Mode, uint32_t dw_Gate, uint32_t dw_Min, uint32_t dw_Max)
 
int i_APCI3660_StartIncChrono (uint8_t boardId, uint32_t dw_Mask)
 
int i_APCI3660_ReadIncCounter (uint8_t boardId, uint32_t dw_Counter, uint32_t *pdw_Value)
 
int i_APCI3660_StopIncChrono (uint8_t boardId, uint32_t dw_Mask)
 
int i_APCI3660_ReleaseIncCounter (uint8_t boardId, uint32_t dw_Counter)
 

Detailed Description

Function Documentation

◆ i_APCI3660_SetIncChronoMode()

int i_APCI3660_SetIncChronoMode ( uint8_t  boardId,
uint32_t  dw_Mode 
)

Set Chrono / Incremental counter

Parameters
[in]boardIdTarget board index
[in]dw_Mode
  • 0 -> Chrono (4 Chronos are used)
  • 1 -> Incremental counter (2 gated incremental counter are used)
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Mode parameter is wrong
-1000The size returned by the driver is wrong

◆ i_APCI3660_GetIncChronoMode()

int i_APCI3660_GetIncChronoMode ( uint8_t  boardId,
uint32_t *  pdw_Mode 
)

Get Chrono / Incremental counter mode

Parameters
[in]boardIdTarget board index
[out]pdw_Mode
  • 0 -> Chrono (4 Chronos are used)
  • 1 -> Incremental counter (2 gated incremental counter are used)
Return values
0No error
-1The boardId parameter is wrong
-1000The size returned by the driver is wrong

◆ i_APCI3660_InitIncCounter()

int i_APCI3660_InitIncCounter ( uint8_t  boardId,
uint32_t  dw_Counter,
uint32_t  dw_Index,
uint32_t  dw_Mode,
uint32_t  dw_Gate,
uint32_t  dw_Min,
uint32_t  dw_Max 
)

Set Chrono / Incremental counter

Parameters
[in]boardIdTarget board index
[in]dw_CounterCounter to use (0 or 1)
[in]dw_IndexIndex (0 -> index is not used or 1 -> index reset counter to 0)
[in]dw_Mode
  • Bits 0 and 1 :
    • 0 -> Direct
    • 1 -> Simple
    • 2 -> Double
    • 3 -> Quadruple
  • Bit 2 (Only used if mode is Direct):
    • 0 -> Direction is down
    • 1 -> Direction is up
[in]dw_Gate
  • 0 -> Chrono gate enabled
  • 1 -> Chrono gate disabled
[in]dw_MinBeginning with this value the gate is on
[in]dw_MaxAfter this value the gate is off
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Counter parameter is wrong
-3The dw_Index parameter is wrong
-4The dw_Mode parameter is wrong
-5The dw_Latch parameter is wrong
-6The board is configured for Chronos instead of Incremental counter (See i_APCI3660_SetIncChronoMode function)
-7The Incremental counter is already initialized
-1000The size returned by the driver is wrong

◆ i_APCI3660_StartIncChrono()

int i_APCI3660_StartIncChrono ( uint8_t  boardId,
uint32_t  dw_Mask 
)

Starts Chronos / Incremental counters

Parameters
[in]boardIdTarget board index
[in]dw_MaskMask of counters to start
  • Bit 0 : 1 -> Start the Chrono / Incremental counter 0, 0 -> No effect
  • Bit 1 : 1 -> Start the Chrono / Incremental counter 1, 0 -> No effect
  • Bit 2 : 1 -> Start the Chrono, 0 -> No effect (Only if Chrono mode, see i_APCI3660_SetIncChronoMode)
  • Bit 3 : 1 -> Start the Chrono, 0 -> No effect (Only if Chrono mode, see i_APCI3660_SetIncChronoMode)
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Mask parameter is wrong
-3The dw_Counter parameter is wrong
-1000The size returned by the driver is wrong

◆ i_APCI3660_ReadIncCounter()

int i_APCI3660_ReadIncCounter ( uint8_t  boardId,
uint32_t  dw_Counter,
uint32_t *  pdw_Value 
)

Read incremental counters

Parameters
[in]boardIdTarget board index
[in]dw_CounterCounter to read (0 or 1)
[out]pdw_ValueCounter value
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Mask parameter is wrong
-3The dw_Counter parameter is wrong
-1000The size returned by the driver is wrong

◆ i_APCI3660_StopIncChrono()

int i_APCI3660_StopIncChrono ( uint8_t  boardId,
uint32_t  dw_Mask 
)

Stops Chronos / Incremental counters

Parameters
[in]boardIdTarget board index
[in]dw_MaskMask of counters to stop
  • Bit 0 : 1 -> Stop the Chrono / Incremental counter 0, 0 -> No effect
  • Bit 1 : 1 -> Stop the Chrono / Incremental counter 1, 0 -> No effect
  • Bit 2 : 1 -> Stop the Chrono, 0 -> No effect (Only if Chrono mode, see i_APCI3660_SetIncChronoMode)
  • Bit 3 : 1 -> Stop the Chrono, 0 -> No effect (Only if Chrono mode, see i_APCI3660_SetIncChronoMode)
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Mask parameter is wrong
-1000The size returned by the driver is wrong

◆ i_APCI3660_ReleaseIncCounter()

int i_APCI3660_ReleaseIncCounter ( uint8_t  boardId,
uint32_t  dw_Counter 
)

Release Chrono / Incremental counter

Parameters
[in]boardIdTarget board index
[in]dw_CounterCounter to release (0 to (1 or 3))
Return values
0No error
-1The boardId parameter is wrong
-2The dw_Counter parameter is wrong
-3The selected counter is still running
-1000The size returned by the driver is wrong