AioGetDemoAo


Function

This is a function that gets the analog output value of the demo device.

Format

Ret = AioGetDemoAo ( Id , AoChannelNum , AoChannel , AoData )

Parameters

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

AoChannelNum [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the number of elements in the channel number array.

AoChannel [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stored the channel number.

AoData [ C, C++ : float * ] [ Python : ctypes.POINTER(ctypes.c_float) ]
Specifies the address of the array that stores the data.

Return values

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.

18002

Pointer to AoChannel, AoData is NULL

28000

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

28001

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

28002

A driver inner error occurred

Remarks

This is a function dedicated to the demo device.

The acquired value is voltage or current (switched according to the setting range of the demo device).

You can confirm the current setting range by calling AioGetAoRange function.
You can modify the setting range by calling AioSetAoRange or AioSetAoRangeAll function.

And also, you can modify the Analog output value bye calling AioSingleAoEx or AioMultiAoEx function.

Example

Gets the analog output value of channel 0 to channel 7.

C, C++

long Ret;
short AoChannel[8];
float AoData[8];
short i;
for( i = 0 ; i < 8 ; i++ ){
    AoChannel[i] = i;
}
Ret = AioGetDemoAo ( Id , 8 , &AoChannel[0] , &AoData[0] );
 

Python

Ret = ctypes.c_long()
AoChannelType = ctypes.c_short * 8
AoChannel = AoChannelType()
AoDataType = ctypes.c_float * 8
AoData = AoDataType()
for i in range(8):
    AoChannel[i] = i
Ret.value = caio.AioGetDemoAo ( Id , 8 , AoChannel , AoData )
 

See also

 AioGetAoRange, AioSetAoRange, AioSetAoRangeAll, AioSingleAoEx, AioMultiAoEx