AioGetAiMaxChannels


Function

Retrieves the maximum number of channels for the analog input. This function supports multi-process.

Format

Ret = AioGetAiMaxChannels ( Id , AiMaxChannels )

Parameters

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

AiMaxChannels [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the maximum number of channels.

Return value

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.

11720

Pointer to AiMaxChannels is NULL
Specify the address of variable to parameter.

20002

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

Remarks

The maximum number of channels differs by the device that you use.
And, it changes depending on the analog input method (Single-end input or Differential input) and whether or not the multiplexer is used.
If the device without the analog input functionality, AiMaxChannels = 0.
If the device is in operation, the function cannot be performed.

Specifications based on devices

AI-1204Z-PE

AiMaxChannels = 4 is fixed

AI-1664UG-PE

Initial value is AiMaxChannels = 64, it is automatically changed by the settings of analog input method.

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

Initial value is AiMaxChannels = 32, it is automatically changed by the settings of analog input method.

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

AiMaxChannels = 8 is fixed

AD16-64(LPCI)LA
AI-1664LA-LPE

Initial value is AiMaxChannels = 64, It is automatic changed by the settings of analog input method.

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

AiMaxChannels = 16 is fixed

AD12-16(PCI)EV
AD12-16U(PCI)EV
AD16-16(PCI)EV
AD16-16U(PCI)EV
AIO-121601E3-PE
AIO-121601UE3-PE
AIO-161601E3-PE
AIO-161601UE3-PE
AI-1216I2-PCI

It is automatic decided by the multiplexer or without multiplexer, and the JP settings of the analog input method.

AD12-64(PCI)

Initial value is AiMaxChannels = 64, It is automatic changed by the settings of analog input method

AD12-16(PCI)

Initial value is AiMaxChannels = 16, It is automatic changed by the settings of analog input method.

AI-1604CI2-PCI

AiMaxChannels = 4 is fixed

AI-1608AY-USB
AIO-160802AY-USB
AI-1608GY-USB
AIO-160802GY-USB

AiMaxChannels = 8 is fixed

AIO-163202FX-USB

Initial value is AiMaxChannels = 32, it is automatically changed by the settings of analog input method.

AI-1664LAX-USB

Initial value is AiMaxChannels = 64, it is automatic changed by the settings of analog input method.

AIO-121602LN-USB

Initial value is AiMaxChannels = 16, it is automatic changed by the settings of analog input method.

AIO-120802LN-USB

Initial value is AiMaxChannels = 16, it is automatic changed by the settings of analog input method.

AI-1004LY-WQ
AI-1004LY-WQ-EU
AI-1004LY-WQ-US
AI-1004LY-WQ-CN

AiMaxChannels = 4 is fixed

CPSN-AI-1208LI
CPSN-AI-2408LI

Initial value is AiMaxChannels = 8, it is automatic changed by the settings of analog input method.

AI-1608VIN-USB
AI-1608AIN-USB
AI-1608VIN-ETH
AI-1608AIN-ETH

AiMaxChannels = 8 is fixed

CPI-AI-1208LI

Initial value is AiMaxChannels = 8, it is automatic changed by the settings of analog input method.

AIO-16256256-DEMO

Initial value is AiMaxChannels = 256, it is automatic changed by the settings of analog input method.

Example

Retrieves the maximum number of channels for the analog input.

C, C++

long Ret;
short AiMaxChannels;
Ret = AioGetAiMaxChannels ( Id , &AiMaxChannels );
 

Python

Ret = ctypes.c_long()
AiMaxChannels = ctypes.c_short()
Ret.value = caio.AioGetAiMaxChannels ( Id , ctypes.byref(AiMaxChannels) )
 

See also

AioSetAiChannels AioGetAiChannels