Function
Sets digital filter.
Format
Ret = DioSetDigitalFilter ( Id , FilterValue )
Parameters
Id
[ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.
FilterValue
[ C, C++: short ] [ Python: ctypes.c_short ]
Specify the digital filter value to be set.
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
DIO_ERR_SYS_FILTER |
20400 |
Filter time constant is outside of the specified range. |
The other errors: (See also: Error code details)
Initial Value
The digital filter value is set to 0 (Digital Filter Not Used).
CPSN-DI-16BCL |
When used with the CPSN-MCB271, the initial value immediately after power-on depends on the setting in the Web browser. |
Remarks
Digital filter is a hardware function that
makes the input value not change when the input bit doesn't remain ON
or OFF in a certain period of time.
By using digital filter, the invalid input signals produced by the noise
and chattering could be cut.
After considering the length of the device's chattering connecting at the
external and the length of valid signals and so on, you could select which
digit of time should be specified to be the coefficient.
CPS-DIO-0808L CPS-DIO-0808BL CPS-DIO-0808RL CPS-DI-16L CPS-DI-16RL |
|
||||||||||||||||||||||||||||||||||||||||||||
CPSN-DI-08FCL CPSN-DI-08FCRL |
|
||||||||||||||||||||||||||||||||||||||||||||
CPSN-DI-08L CPSN-DI-08BL
|
|
||||||||||||||||||||||||||||||||||||||||||||
CPSN-DI-16BCL |
|
||||||||||||||||||||||||||||||||||||||||||||
DIO-1616LN-ETH DIO-1616RYN-ETH |
* It is a simple filter by software.
|
||||||||||||||||||||||||||||||||||||||||||||
DIO-0404LY-WQ |
* It is a simple filter by software.
|
||||||||||||||||||||||||||||||||||||||||||||
DIO-1616LN-USB DIO-0808LY2-USB DIO-0808TY2-USB DI-16TY2-USB |
* It is a simple filter by software.
|
||||||||||||||||||||||||||||||||||||||||||||
PIO-XX(XX)H PI-XX(XX)H PIO-16/16RY(PCI) DIO-XXXX-PE DI-XX-PE DIO-XXXXLX-USB DIO-1616RYX-USB DIO-1616RYX2-USB |
|
Example
Not use the digital filter.
C, C++ |
long Ret; Ret = DioSetDigitalFilter(Id,
0); |
Python |
Ret = ctypes.c_long() Ret.value = cdio.DioSetDigitalFilter(Id,
0) |
See Also
DioInpByte
DioInpBit
DioInpMultiByte
DioInpMultiBit
DioSetInterruptEvent