xPCI-3009 API
PCI-3009 incremental counter initialisation functions

Functions

_INT_ i_PCI3009_InitCounter (DWORD_ dw_BoardHandle, BYTE_ b_CounterRange, BYTE_ b_FirstCounterModus, BYTE_ b_FirstCounterOption, BYTE_ b_SecondCounterModus, BYTE_ b_SecondCounterOption)
 
_INT_ i_PCI3009_CounterAutoTest (DWORD_ dw_BoardHandle, PBYTE_ pb_TestStatus)
 
_INT_ i_PCI3009_ClearCounterValue (DWORD_ dw_BoardHandle)
 
_INT_ i_PCI3009_SetInputFilter (DWORD_ dw_BoardHandle, BYTE_ b_Filter)
 

Detailed Description

Function Documentation

_INT_ i_PCI3009_InitCounter ( DWORD_  dw_BoardHandle,
BYTE_  b_CounterRange,
BYTE_  b_FirstCounterModus,
BYTE_  b_FirstCounterOption,
BYTE_  b_SecondCounterModus,
BYTE_  b_SecondCounterOption 
)

Configure the counter operating mode
You must calling this function be for you call any other function witch access of counters.

                     <b>Counter range</b>\n
Parameter Passed value Description
b_CounterRange PCI3009_16BIT_COUNTER The module is configured for two 16-bit counter.
  • b_FirstCounterModus and b_FirstCounterOption
    configure the first 16 bit counter.
  • b_SecondCounterModus and b_SecondCounterOption
    configure the second 16 bit counter.
b_CounterRange PCI3009_32BIT_COUNTER The module is configured for one 32-bit counter.
  • b_FirstCounterModus and b_FirstCounterOption
    configure the 32 bit counter.
  • b_SecondCounterModus and b_SecondCounterOption
    are not used and have no importance.


Counter operating mode

Parameter Passed value Description
b_FirstCounterModus or b_SecondCounterModus PCI3009_QUADRUPLE_MODE In the quadruple mode, the edge analysis circuit generates a counting pulse from each edge of 2 signals which are phase shifted in relation to each other.
b_FirstCounterModus or b_SecondCounterModus PCI3009_DOUBLE_MODE Functions in the same way as the quadruple mode, except that only two of the four edges are analysed per period
b_FirstCounterModus or b_SecondCounterModus PCI3009_SIMPLE_MODE Functions in the same way as the quadruple mode, except that only one of the four edges is analysed per period.
b_FirstCounterModus or b_SecondCounterModus PCI3009_DIRECT_MODE In the direct mode the both edge analysis circuits are inactive. The inputs A, B in the 32-bit mode or A, B and C, D in the 16-bit mode represent, each, one clock pulse gate circuit. There by frequency and pulse duration measurements can be performed.


IMPORTANT!
If you have configured the module for two 16-bit counter, a mixed
mode with a counter in quadruple/double/single mode
and the other counter in direct mode is not possible!


Counter operating option for quadruple/double/simple mode

Parameter Passed value Description
b_FirstCounterOption or b_SecondCounterOption PCI3009_HYSTERESIS_ON In both edge analysis circuits is available one hysteresis circuit. It suppresses each time the first counting pulse after a change of rotation.
b_FirstCounterOption or b_SecondCounterOption PCI3009_HYSTERESIS_OFF The first counting pulse is not suppress after a change of rotation.


IMPORTANT!
This option are only avaible if you have selected the direct mode.


Counter operating option for direct mode

Parameter Passed value Description
b_FirstCounterOption or b_SecondCounterOption PCI3009_INCREMENT The counter increment for each counting pulse
b_FirstCounterOption or b_SecondCounterOption PCI3009_DECREMENT The counter decrement for each counting pulse
Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_CounterRange: Selection form counter range.
[in]b_FirstCounterModus: First counter operating mode.
[in]b_FirstCounterOption: First counter option.
[in]b_SecondCounterModus: Second counter operating mode.
[in]b_SecondCounterOption: Second counter option.
Returns
0: 0: No error
-1: The handle parameter of the board is wrong
-2: The module is not a counter module
-3: The selected counter range is wrong.
-4: The selected first counter operating mode is wrong.
-5: The selected first counter operating option is wrong
-6: The selected second counter operating mode is wrong.
-7: The selected second counter operating option is wrong.
_INT_ i_PCI3009_CounterAutoTest ( DWORD_  dw_BoardHandle,
PBYTE_  pb_TestStatus 
)

A test mode is intended for testing the component and
the connected periphery. All the 8-bit counter chains
are operated internally as down counters.
Independently from the external signals,
all the four 8-bit counter chains are decremented in
parallel by each negative clock pulse edge of CLKX.

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[out]pb_TestStatus: Auto test conclusion.
0 : No error
1 : Error
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: The module is not a counter module
_INT_ i_PCI3009_ClearCounterValue ( DWORD_  dw_BoardHandle)

Clear the counter value . |

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: The module is not a counter module
-3: Counter not initialised see function "i_PCI3009_InitCounter"
_INT_ i_PCI3009_SetInputFilter ( DWORD_  dw_BoardHandle,
BYTE_  b_Filter 
)

Disable or enable the software filter from selected b_Filter determine the filter time

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_Filter: Filter selection

b_Filter Filter time
0 Disabled
1 100ns
2 150ns
3 200ns
4 250ns
5 300ns
6 350ns
7 400ns
8 450ns
9 500ns
10 550ns
11 600ns
12 650ns
13 700ns
14 750ns
15 800ns
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: The module is not a counter module
-3: Counter not initialised see function "i_PCI3009_InitCounter"
-4: The selected filter value is wrong