AioSetAiDigitalFilter


Function

Sets the digital filter for analog input signal.

This function is used by CPSN-AI-2408LI (When connecting to USB I/O Unit-Module Type) only.

Format

Ret = AioSetAiDigitalFilter ( Id ,  AiChannel , FilterType , FilterValue )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit function.

AiChannel [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specifies the input channel for setting filter.

FilterType [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the filter type.

Value [dec]

Filter type

0

Power supply noise rejection (Disabled)

1

Power supply noise rejection (Enabled)

FilterValue [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the filter value.(The channel switching rate also changes according to the filter value.)

■Power supply noise rejection (Disabled)

Filter value [dec]

Channel switching rate[msec]

Cut-off frequency (-3dB)[Hz] *1

0

319

2.56

1

200

5.44

2

100

8.16

3

50

16.32

4

25

32.64

5

12.5

65.28

6

6.25

130.56

7

3.13

261.12

8

1.67

552

9

0.833

1104

10

0.417

1500*2

11

0.208

1500*2

■Power supply noise rejection (Enabled)

Filter value [dec]

Channel switching rate[msec]

Cut-off frequency (-3dB)[Hz] *1

50Hz±1Hz, 60Hz±1Hz Interference rejection ratio[dB] *1

0

59.9

12.66

92

1

50

13.88

86

2

40

15.12

62

3

36.7

17.28

47

*1 Cut-off frequency and Interference rejection ratio are theoretical values.
*2 The input frequency band is limited to 1500Hz (-3dB) approx. due to the LPF (RC filter) within the input section.

Return value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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.

20001

This function can't be used by this device

22500

The AiChannel value is out of range for your device.

22501

The FilterType value is out of range for your device.

22502

The FilterValue value is out of range for your device.

Initial value

FilterType = 1 (Power supply noise rejection (Enabled)) and FilterValue = 2 (Channel switching rate: 40msec).

Remarks

Sets the digital filter for analog input signal.

The digital filter set in FilterValue is applied to the specified channel.
(The channel switching time also changes according to the filter setting value.)

Enable or disable the digital filter that rejections power supply noise (50 / 60Hz) with the Filter Type.

Example

Sets the Power supply noise rejection (Enabled) and Channel switching rate: 40msec(Cut-off frequency: 15.12 Hz)  for 0 channel.

VB.NET

Dim Ret As Integer

Ret = AioSetAiDigitalFilter ( Id , 0 , 1 , 2 )
 

C, C++

long Ret;

Ret = AioSetAiDigitalFilter ( Id , 0 , 1 , 2 );
 

C#

int Ret;

Ret = aio.SetAiDigitalFilter ( Id , 0 , 1 , 2 );
 

Python

Ret = ctypes.c_long()

Ret.value = caio.AioSetAiDigitalFilter ( Id , 0 , 1 , 2 )