CalCounterSetDigitalFilter

Purpose

Sets the specified channel filter value and mode.

Syntax

CalCounterSetDigitalFilter (hHandle, nChannel, lFilterMode, lFilterValue, plStatus)

Parameters

Name
Type
Comments
hHandle
LONG
Handle for a Counter.
nChannel
SHORT
Select channel (0-based) .
lFilterMode
PSTR
Digital Filter mode:
0.      Filter is enabled and the driver analyzes the measured signal and determines the best filter value each time a measurement is done.
1.      Filter is enabled and the user sets the filter value, see lFilterValue parameter for details.
lFilterValue
LONG
Filter value is an integer representing filter value in uSec, e.g. value of 50 represents 50uSec. Filter value range from 5 to 6400, (5uSec to 6400uSec).
plStatus
PLONG
Returned status: 0 on success, negative number on failure.

Comments

The Filter should be used when measuring low frequencies (less than 20KHz) superimposed with a high-frequency noise. The Filter value adds a delay equal to lFilterValue in microseconds. After first trigger is detected the counter will disregard any additional trigger events for lFilterValue microseconds.

Note: The delay needs to be less than half of the expected frequency signal duty cycle. Filter value can be set when the filter mode is set to fixed value.

The filter value should be set according to the following equation:

 

E.g.: if the expected value is about 10KHz then filter value should be around 25uSec.

Example

The following example sets channel 0’s filter value to 55uSec:

 

LONG   lHandle, lStatus;

 

CalCounterSetDigitalFilter (lHandle, 0, 2, 55, &lStatus);

 

See Also

CalCounterMeasure, CalCounterSetFunctionPulseWidth, CalCounterSetGateTime, CalCounterSetTriggerLevel, CalCounterGetError