AioSetCntFilter


Function

Sets the filter for the counter input signal.

Format

Ret = AioSetCntFilter ( Id , CntChannel , Signal , Value )

Parameters

Id [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit.

CntChannel [ C, C++ : short ] [ Python : ctypes.c_short ]
Sets the channel of counter.
Only -1 can be set now, this setting is for all channels.

Signal [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the input signal for setting filter.
Only -1 can be set now.

Input signal

Value

All signals above

-1

Value [ C, C++ : float ] [ Python : ctypes.c_float ]
Sets the filter time.

Filter time

0 (Not use)

1

128

16000

Return values

Ret [ C, C++ : long ] [ Python : ctypes.c_long ]

Return values

Content

0

Normality completion

7

Execute AioResetDevice function because the device has recovered from standby mode

10001

Invalid Id was specified
Use the Id retrieved from AioInit to specify the Id in this function.

10002

AIO driver can't be called
At first, perform AioInit function.

15120

The value of CntChannel is outside the designated range of the function

15121

The value of Signal is outside the designated range of the function

15122

The value of Value is outside the designated range of the function

20001

This function can't be used by this device

20002

Can not use while by another device works
To use this function, counter operation must be stopped.

20003

Can not use because another process is using the device
When another process is using the device, all functions except for those that support multi-process can not be performed.

25120

The value of CntChannel is outside the designated range of the device being used

25121

The value of Value is outside the designated range of the device being used

25123

The value of Signal is outside the designated range of the device being used

Initial values

For all signal lines, filter is disabled

Remarks

If the filter is set, the high frequency component (noise, chattering and so on) can be removed.

The larger the value of filter time setting is, the better the noise and chattering can be avoided. But the delay time of switching between ON and OFF will become longer.

This function cannot be used on devices without counter functionality.
If the device is in operation, the function cannot be performed.

Specifications based on devices

AIO-163202F-PE
ADA16-32/2(PCI)F

The individual filter cannot be set for each channel. Channel -1 is fixed.
Setting is for all channels regardless of the channel setting.
Usable Value is 0, 1, 128, 16000.

AI-1664UG-PE
AIO-163202G-PE
AIO-163202UG-PE
AIO-123202G-PE
AIO-123202UG-PE

The individual filter cannot be set for each channel. Channel -1 is fixed.
Setting is for all channels regardless of the channel setting.
Usable Value is 0, 0.125, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0, 8192.0, 16000.0.

The digital input signal is sampled at each filter time, and when 4 consecutive High (or Low) are detected, it is notified to the input circuit.
Therefore, the signal is delayed by 4 times the set filter time

AIO-160802L-LPE
ADA16-8/2(LPCI)L
ADAI16-8/2(LPCI)L
AIO-160802LI-PE

Channel -1 is fixed.
Usable Value is 0 or 1.

AI-1616L-LPE
AD16-64(LPCI)LA
AD16-16(LPCI)L
ADI16-16(LPCI)L
AI-1616LI-PE
AI-1664LA-LPE

Channel -1 is fixed.
Usable Value is 0 or 1.

AO-1604L-LPE
DA16-16(LPCI)L
DA16-8(LPCI)L
DA16-4(LPCI)L
DAI16-4(LPCI)L
AO-1604LI-PE
AO-1608L-LPE
AO-1616L-LPE

Channel -1 is fixed.
Usable Value is 0 or 1.

AIO-163202FX-USB

Channel -1 is fixed.
The individual filter cannot be set for each channel.
Setting is for all channels regardless of the channel setting.
Usable Value is 0, 1, 128, 16000.

AIO-121602LN-USB
AIO-120802LN-USB

Channel -1 is fixed.
Usable Value is 0, 1, 128, 16000.

AI-1664LAX-USB

Channel -1 is fixed.
Usable Value is 0 or 1.

AO-1604LX-USB

Channel -1 is fixed.
Usable Value is 0 or 1.

Example

Sets 1usec to the filter for all signals.

C, C++

long Ret;
Ret = AioSetCntFilter ( Id , -1 , -1 , 1.0 );
 

Python

Ret = ctypes.c_long()
Ret.value = caio.AioSetCntFilter ( Id , -1 , -1 , 1.0 )