Function
Reads the sampling data of specified times
from the device memory (software memory).
This function can only be used when the transfer mode of the conversion
data that is set by AioSetAiTransferMode is Device buffer mode.
It cannot be used when the transfer mode of the conversion data is User
buffer mode.
Format
Ret = AioGetAiSamplingData ( Id , AiSamplingTimes , AiData )
Parameters
Id
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the Device ID retrieved from AioInit function.
AiSamplingTimes
[ C, C++ : long * ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of variable which has stored the sampling times of
acquiring
data.
After this function is executed, return the actual number of samplings
which has been read.
AiData
[ C, C++ : long * ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of array which stores the converted data. The converted
data are stored in binary value.
Resolution of device is 12 bit |
0 to 4095 |
Resolution of device is 16 bit |
0 to 65535 |
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 |
10002 |
AIO
driver can't be called |
11580 |
Pointer
to AiSamplingTimes is NULL |
11581 |
Pointer
to AiData is NULL |
11582 |
The value of AiSamplingTimes is outside the designated range of the function |
20001 |
This function can't be used by this device |
20003 |
Can
not use because another process is using the device |
21580 |
It
tried to acquire data beyond the converted number |
21584 |
FIFO is empty |
21585 |
It tried to acquire data beyond the memory size. AiSamplingTimes is changed to the maximum value |
Remarks
In AioStartAi, the used data are stored by each channel.
The usage differs by the memory type.
In FIFO memory:
Usually the old data is read in.
The data that has ever been read cannot be reread.
It can be used if the device is in operation.
In RING memory:
Retrieves the data of the specified sampling number from the latest data.
The same data can be repeated retrieved.
It can't be used if the device is in operation.
When you use this function and "simple functions", please refer "How to use simple functions and continuous functions at the same time" topics.
This function cannot be used on devices without the analog input function.
Example
Reads the sampling data of 1000 times.
C, C++ |
long
Ret; |
Python |
Ret
= ctypes.c_long() |
See also
AioSetAiMemoryType AioGetAiMemoryType