Retrieves the filter setting for the analog input value.
Ret = AioGetAiFilter ( 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)
]
Specifies the base address of the array that stores the filter types.
FilterValueLow
[ C, C++:unsigned long long *] [ Python: ctypes.POINTER(ctypes.c_ulonglong)
]
Specifies the base address of the array that stores the filter lower limit value.
If filter type is "Filter disabled", this parameter is not used.
FilterValueHigh
[ C, C++:unsigned long long *] [ Python: ctypes.POINTER(ctypes.c_ulonglong)
]
Specifies the base address of the array that stores the filter upper limit value.
If filter type is "Filter disabled", 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 |
12560 |
Pointer to FilterType is NULL |
12561 |
Pointer to FilterValueLow is NULL |
12562 |
Pointer to FilterValueHigh is NULL |
12563 |
Pointer to FilterUnit is NULL |
20001 |
This function can't be used by this device |
22560 |
The value of AiChannelNo is outside the designated range of the device being used |
Filter disabled (FilterType = 0)
Retrieves the filter setting for the analog input value.
If FilterValueLow/FilterValueHigh is smaller than the unit (FilterUnit), each value will be retrieved as 0.
Example:
For 20kHz, if it is retrieved in unit kHz, the value (FilterValueLow/FilterValueHigh) will be 20.
For 20kHz, if it is retrieved in unit MHz, the value (FilterValueLow/FilterValueHigh) will be 0.
Retrieves the filter type and filter upper/lower limit value set for channel 0 in unit MHz.
C, C++ |
long
Ret; AiChannelNo[0] = 0; Ret = AioGetAiFilter ( Id , &AiChannelNo[0]
, 1 , &FilterType[0] , &FilterValueLow[0], &FilterValueHigh[0]
, &FilterUnit[0] ) |
Python |
Ret
= ctypes.c_long() AiChannelNo[0] = 0 Ret.value = caio.AioGetAiFilter (
Id , AiChannelNo , 1 , FilterType , FilterValueLow, FilterValueHigh
, FilterUnit ) |