AioGetAiFilter


Function

Retrieves the filter setting for the analog input value.

Format

Ret = AioGetAiFilter ( Id ,  AiChannelNo , AiChannelNum , FilterType , FilterValueLow , FilterValueHigh , FilterUnit )

Parameters

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

Return value

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

Return values

Content

0

Normality completion

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.

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

Initial value

Filter disabled (FilterType = 0)

Remarks

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.

Example

Retrieves the filter type and filter upper/lower limit value set for channel 0 in unit MHz.

C, C++

long Ret;
unsigned short AiChannelNo[0];
unsiged short FilterType[0];
unsigned long long FilterValueLow[0];
unsigned long long FilterValueHigh[0];
unsigned short FilterUnit[0];

AiChannelNo[0] = 0;
FilterUnit[0] = AIO_PARAM_AI_FILTER_UNIT_MEGA_HZ;

Ret = AioGetAiFilter ( Id , &AiChannelNo[0] , 1 , &FilterType[0] , &FilterValueLow[0], &FilterValueHigh[0] , &FilterUnit[0] )
 

Python

Ret = ctypes.c_long()
AiChannelNoType = ctypes.c_ushort() * 1
AiChannelNo = AiChannelNoType()
FilterTypeType = ctypes.c_ushort() * 1
FilterType = FilterTypeType()
FilterValueLowType = ctypes.c_ulong() * 1
FilterValueLow = FilterValueLowType ()
FilterValueHighType = ctypes.c_ulong() * 1
FilterValueHigh = FilterValueHighType()
FilterUnitType = ctypes.c_ushort() * 1
FilterUnit = FilterUnitType()  

AiChannelNo[0] = 0
FilterUnit[0] = caio.AIO_PARAM_AI_FILTER_UNIT_MEGA_HZ

Ret.value = caio.AioGetAiFilter ( Id , AiChannelNo , 1 , FilterType , FilterValueLow, FilterValueHigh , FilterUnit  )
 

See also

AioSetAiFilter