AioMultiAoEx


Function

DA Converts the more than one channel one time, the conversion data are specified in voltage or current. This function supports multi-process.

Format

Ret = AioMultiAoEx ( Id , AoChannels , AoData )

Parameters

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

AoChannels [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the number of channels to be converted.

AoData [ C, C++ : float * ] [ Python : ctypes.POINTER(ctypes.c_float) ]
Specifies the address of the array that stores the output data. Please specify the data in voltage or current.
The available value differs by the device.

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.

13520

The value of AoChannels is outside the designated range of the function

13521

Pointer to AoData 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 output operation must be stopped.

23520

DA conversion error occurred

23521

The number of conversion channels was exceeded. It is converted on the maximum channels

Remarks

If a device has the synchronous output function, it outputs the set channels at the same time.
If the device have no the synchronous output function, it transparently (one after another output) outputs to the channels in the order of channel 0, 1, 2 and so on.

Before this function is executed, you must set the output range by using AioSetAoRange or AioSetAoRangeAll function
This function cannot be used on devices without the analog output 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

It outputs voltage data 5V to channel 0 to channel 7.

C, C++

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

Python

Ret = ctypes.c_long()
AoDataType = ctypes.c_float * 8
AoData = AoDataType()
for i in range(8):
    AoData[i] = 5.0
Ret.value = caio.AioMultiAoEx ( Id , 8 , AoData )
 

See also

AioSingleAoEx