DioSetDigitalFilter
Function
Sets digital filter.
Format
Ret = DioSetDigitalFilter
( Id , FilterValue )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from DioInit.
FilterValue
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the digital filter value to be set.
Return Value
Ret
[ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long
]
Definition |
Value
[Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal
completed. |
DIO_ERR_SYS_RECOVERED_FROM_STANDBY |
7 |
Execute
DioResetDevice function because the device has recovered from
standby mode. |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid
ID specified. |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This
board couldn't use this function. |
DIO_ERR_SYS_BOARD_EXECUTING |
20002 |
Board
is behaving, not execute. |
DIO_ERR_SYS_FILTER |
20400 |
Filter
number beyond the limit. |
The others (See also: Details
of Error Code)
Initial Value
The digital filter value is set to 0 (Digital
filter unused).
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
This function is used to cut the invalid
input signal by the noise and chattering.
Specifications based on devices
CPS-DIO-0808L
CPS-DIO-0808BL
CPS-DIO-0808RL
CPS-DI-16L
CPS-DI-16RL |
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
Filter Not Used |
1 |
0.25
[usec] |
2 |
0.5 [usec] |
3 |
1 [usec] |
4 |
2 [usec] |
5 |
4 [usec] |
6 |
8 [usec] |
7 |
16 [usec] |
8 |
32 [usec] |
9 |
64 [usec] |
10 |
128 [usec] |
11 |
256 [usec] |
12 |
512 [usec] |
13 |
1024
[usec] |
14 |
2.048
[msec] |
15 |
4.096
[msec] |
16 |
8.192
[msec] |
17 |
16.384
[msec] |
18 |
32.768
[msec] |
19 |
65.536
[msec] |
20 |
131.072
[msec] |
|
CPSN-DI-08FCL
CPSN-DI-08FCRL |
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 |
0.1 [usec] |
2 |
0.2 [usec] |
3 |
0.4 [usec] |
4 |
0.8 [usec] |
5 |
1.6 [usec] |
6 |
3.2 [usec] |
7 |
6.4 [usec] |
8 |
12.8
[usec] |
9 |
25.6
[usec] |
10 |
51.2
[usec] |
11 |
102.4
[usec] |
12 |
204.8
[usec] |
13 |
409.6
[usec] |
14 |
819.2
[usec] |
15 |
1.6384
[msec] |
16 |
3.2768
[msec] |
17 |
6.5536
[msec] |
18 |
13.1072
[msec] |
19 |
26.2144
[msec] |
20 |
52.4288
[msec] |
|
CPSN-DI-08L
CPSN-DI-08BL
|
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 |
Digital
filter used |
|
CPSN-DI-16BCL |
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 to 1000 |
Setting
Value [msec] |
|
DIO-1616LN-ETH
DIO-1616RYN-ETH |
*
It is a simple filter by software.
* The filter is invalid for interrupts.
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 to 16 |
Reserved |
17 |
16.384
[msec] |
18 |
32.768
[msec] |
19 |
65.536
[msec] |
20 |
131.072
[msec] |
|
DIO-1616LN-USB
DIO-0808LY2-USB
DIO-0808TY2-USB
DI-16TY2-USB |
*
It is a simple filter by software.
* The filter is invalid for interrupts.
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 to 11 |
Reserved |
12 |
512 [usec] |
13 |
1024
[usec] |
14 |
2.048
[msec] |
15 |
4.096
[msec] |
16 |
8.192
[msec] |
17 |
16.384
[msec] |
18 |
32.768
[msec] |
19 |
65.536
[msec] |
20 |
131.072
[msec] |
|
DIO-0404LY-WQ |
*
It is a simple filter by software.
* The filter is invalid for interrupts.
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 to 12 |
Reserved |
13 |
1.024
[msec] |
14 |
2.048
[msec] |
15 |
4.096
[msec] |
16 |
8.192
[msec] |
17 |
16.384
[msec] |
18 |
32.768
[msec] |
19 |
65.536
[msec] |
20 |
131.072
[msec] |
|
DIO-0404RY-LWF
DIO-0404RY-LWF-US |
*
It is a simple filter by software.
* The filter is invalid for interrupts.
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 to 13 |
Reserved |
14 |
2.048
[msec] |
15 |
4.096
[msec] |
16 |
8.192
[msec] |
17 |
16.384
[msec] |
18 |
32.768
[msec] |
19 |
65.536
[msec] |
20 |
131.072
[msec] |
|
PIO-XX(XX)H
PI-XX(XX)H
PIO-16/16RY(PCI)
DIO-XXXX-PE
DI-XX-PE
DIO-XXXXLX-USB
DIO-1616RYX2-USB |
Digital Filter Setting Value
[Dec] |
Setting Time |
0 |
Digital
filter unused |
1 |
0.25[usec] |
2 |
0.50[usec] |
3 |
1.0[usec] |
4 |
2.0[usec] |
5 |
4.0[usec] |
6 |
8.0[usec] |
7 |
16[usec] |
8 |
32[usec] |
9 |
64[usec] |
10 |
128[usec] |
11 |
256[usec] |
12 |
512[usec] |
13 |
1.024[msec] |
14 |
2.048[msec] |
15 |
4.096[msec] |
16 |
8.192[msec] |
17 |
16.384[msec] |
18 |
32.768[msec] |
19 |
65.536[msec] |
20 |
131.072[msec] |
|
Example
Sets digital filter to
unused.
VB.NET |
Dim Ret As Integer
Ret = DioSetDigitalFilter ( Id , 0 )
|
C, C++ |
long Ret;
Ret = DioSetDigitalFilter ( Id , 0 );
|
C# |
int Ret;
Ret = dio.SetDigitalFilter ( Id , 0 );
|
Python |
Ret = ctypes.c_long()
Ret.value = cdio.DioSetDigitalFilter ( Id , 0 )
|
See Also
DioInpByte
DioInpBit DioInpMultiByte
DioInpMultiBit