AioSingleAiEx


Function

Converts the specified channel one time, the conversion data are returned in voltage/current. This function supports multi-process.

Format

Ret = AioSingleAiEx ( Id , AiChannel , AiData )

Parameters

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

AiChannel [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the channel to be converted.

AiData [ C, C++ : float * ] [ Python : ctypes.POINTER(ctypes.c_float) ]
Specifies the address of the variable that stores the converted data. The converted data are stored in voltage or current value.

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.

11840

The value of AiChannel is outside the designated range of the function
Specify the channel setting in range: 0 <= AiChannel <= Max channel.

11841

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

20001

This function can't be used by this device

20002

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

21840

The value of AiChannel is outside the designated range of the device being used

21843

The channel which isn't being used for the conversion is specified

Remarks

Before this function is executed, you must set the input range by using AioSetAiRange or AioSetAiRangeAll function.
This function cannot be used on devices without the analog input function.
If the device is in operation, the function cannot be performed.

When you use this function and "continuous functions", please refer "How to use simple functions and continuous functions at the same time" topics.

Example

Converts Channel 0 one time.

C, C++

long Ret;
float AiData;
Ret = AioSingleAiEx ( Id , 0 , &AiData );
 

Python

Ret = ctypes.c_long()
AiData = ctypes.c_float()
Ret.value = caio.AioSingleAiEx ( Id , 0 , ctypes.byref(AiData) )
 

See also

AioMultiAiEx

Channel Multi-process Resolution Transfer data format