AioSetAoSamplingDataEx


Function

Sets the output data. The output data is specified in voltage or current.

Format

Ret = AioSetAoSamplingDataEx ( Id , AoSamplingTimes , AoData )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit function.

AoSamplingTimes [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ Python : ctypes.c_long ]
Sets the number of generatings for the output data.

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

Return value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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.

13540

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

13541

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.

20003

Can not use because another process is using the device
When another process is using the device, all functions except for those that support multi-process can not be performed.

23540

Output data exceed memory capacity

23541

Failed in the allocation of the memory

Remarks

The usage differs by the memory type.

FIFO
The output data is added at the end of the memory after this function is executed every time.
Clear the data from the memory by using AioResetAoMemory function.
The output data can be added even if the device is in operation.

RING
It ensures the output data which is set by function in the memory.
If this function is executed once more, the last memory data are lost. 
It can't be used if the device is in operation.

Before this function is executed, please perform AioSetAoMemoryType function.

Example

Sets the 1000 generating output data.

VB.NET

Dim Ret As Integer
Dim AoData(1000) As Single
Dim i As Short
For i = 0 To 999
    AoData( i ) = 5.0
Next i
Ret = AioSetAoSamplingDataEx ( Id , 1000 , AoData )
 

C, C++

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

C#

int Ret;
float[] AoData = new float[1000];
short i;
for( i = 0 ; i < 1000 ; i++ ){
    AoData[i] = 5.0F;
}
Ret = aio.SetAoSamplingDataEx ( Id , 1000 , AoData );
 

Python

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

See also

AioSetAoSamplingData AioGetAoSamplingTimes