16 s826_counterfilterwrite, 17 s826_counterfilterread, S826_counterfilterwrite – Sensoray 826 User Manual
Page 47: S826_counterfilterread

If the function fails, the return value is an error code.
7.3.16 S826_CounterFilterWrite
The S826_CounterFilterWrite function configures the IX, CLKA, and CLKB noise filters.
int S826_CounterFilterWrite(
uint board, // board identifier
uint chan, // counter channel number
uint cfg // filter configuration
);
Parameters
board
826 board number. This must match the settings of the board's dip switches as described in section 2.2.
chan
Counter channel number in the range 0 to 5.
cfg
Filter configuration:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
IX
CK
0
T
Field
Description
IX
Enable IX filter: '1' = enable, '0' = disable.
CK
Enable CLKA/CLKB filters: '1' = enable, '0' = disable.
T
Filter time interval specified as multiple of 20ns, common to IX, CLKA and CLKB input filters.
Return Values
If the function succeeds, the return value is zero.
If the function fails, the return value is an error code.
Remarks
Each of the IX, CLKA, and CLKB input signals has a dedicated noise filter. This function enables and disables the
filters and programs the filter time interval. The CLKA and CLKB filters are enabled or disabled as a group, whereas
the IX filter is independently enabled or disabled. The filter time interval, T, is common to all enabled filters.
A filter's output will not change state until its input has held a constant state for T * 20ns. The maximum T value is
65535, corresponding to a filter time of 1.3107ms. When a filter is enabled, it will delay its input signal by T * 20ns.
Note that when the noise filter is enabled for the CLKA/CLKB inputs (CK = '1'), the counter's maximum clock
frequency is reduced; the maximum frequency reduction is inversely proportional to T.
7.3.17 S826_CounterFilterRead
The S826_CounterFilterRead function reads the configuration of the IX, CLKA, and CLKB noise filters.
int S826_CounterFilterRead(
uint board, // board identifier
uint chan, // counter channel number
uint *cfg // filter configuration
);
Parameters
board
826 board number. This must match the settings of the board's dip switches as described in section 2.2.
826 Instruction Manual
42
Counters