Sets the filter for the analog input value.
Ret = AioSetAiFilter ( Id , AiChannelNo , AiChannelNum , FilterType , FilterValueLow , FilterValueHigh , FilterUnit )
Id
[ C, C++: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from AioInit.
AiChannelNo [
C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]
Sets the channel numbers into an array and specifies the base address of the array.
AiChannelNum [
C, C++: unsigned short ] [ Python: ctypes.c_ushort ]
Specifies the number of channels specified in AiChannelNo.
FilterType
[ C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort)
]
Sets the filter types into an array and specifies the base address of the array.
Filter type |
Macro |
Value [dec] |
Filter disabled |
AIO_PARAM_AI_FILTER_TYPE_DISABLE |
0 |
Low-pass filter |
AIO_PARAM_AI_FILTER_TYPE_LOW_PASS |
1 |
FilterValueLow
[ C, C++:unsigned long long *] [ Python: ctypes.POINTER(ctypes.c_ulonglong)
]
Sets the filter lower limit value into an array and specifies the base address of the array.
If filter type is "Filter disabled", this parameter is not used.
If filter type is "Low-pass filter", specify a value for this parameter.
FilterValueHigh
[ C, C++:unsigned long long *] [ Python: ctypes.POINTER(ctypes.c_ulonglong)
]
Sets the filter upper limit value into an array and specifies the base address of the array.
If filter type is "Filter disabled", this parameter is not used.
If filter type is "Low-pass filter", this parameter is not used.
FilterUnit
[ C, C++: unsigned short * ] [ Python: ctypes.POINTER(ctypes.c_ushort)
]
Sets the unit of filter value into an array and specifies the base address of the array.
The filter lower limit value and filter upper limit value have the same unit.
If filter type is "Filter disabled", this parameter is not used.
Unit of filter value |
Macro |
Value [dec] |
MHz |
AIO_PARAM_AI_FILTER_UNIT_MEGA_HZ |
1 |
kHz |
AIO_PARAM_AI_FILTER_UNIT_KIRO_HZ |
2 |
Hz |
AIO_PARAM_AI_FILTER_UNIT_HZ |
3 |
mHz |
AIO_PARAM_AI_FILTER_UNIT_MIRI_HZ |
4 |
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
Return values |
Content |
0 |
Normality completion |
10001 |
Invalid Id was specified |
10002 |
AIO driver can't be called |
20001 |
This function can't be used by this device |
22550 |
The value of AiChannelType is outside the designated range of the device being used |
22551 |
The value of AiChannelNo is outside the designated range of the device being used |
22552 |
The value of FilterType is outside the designated range of the device being used |
22553 |
The value of FilterValueLow is outside the designated range of the device being used |
22554 |
The value of FilterValueHigh is outside the designated range of the device being used |
22555 |
The value of FilterUnit is outside the designated range of the device being used |
Filter disabled (FilterType = 0)
Sets the filter for the analog input value.
AI-80M1202-PE |
The possible setting value are "Filter disabled" or "Low-pass filter 20MHz". |
Set "Low-pass filter" (AIO_PARAM_AI_FILTER_TYPE_LOW_PASS) and filter lower limit value = 20MHz for channel 0.
C, C++ |
long
Ret; AiChannelNo[0] = 0; Ret = AioSetAiFilter ( Id , &AiChannelNo[0]
, 1 , &FilterType[0] , &FilterValueLow[0], &FilterValueHigh[0]
, &FilterUnit[0] ) |
Python |
Ret
= ctypes.c_long() AiChannelNo[0] = 0 Ret.value = caio.AioSetAiFilter (
Id , AiChannelNo , 1 , FilterType , FilterValueLow, FilterValueHigh
, FilterUnit ) |