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.