Sets the transfer size for user buffer mode.
Ret = AioSetAiTransferSize ( Id, AutoMode, TransferSize )
Id [ C, C++ : short ] [ Python : ctypes.c_short ]
Specify the ID obtained by the AioInit function.
AutoMode [ C, C++ : short ] [ Python : ctypes.c_short ]
Specify the method of setting the transfer size from the following range.
Macro |
Value |
|
AI_TRANSFERSIZE_MANUAL |
0 |
Set the transfer size manually |
AI_TRANSFERSIZE_AUTO |
1 |
Set the transfer size automatically |
TransferSize [ C, C++ : long ] [Python : ctypes.c_long]
Specify the transfer size when the transfer size setting method is set to manual.
Transfer size is specified in number of packets.
Please specify 0 if the transfer size setting method is set to auto.
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 |
20001 |
This function can't be used by this device |
20002 |
Can not use while by another device works |
20003 |
Can not use because another process is using the device |
22520 |
An internal driver error has occurred. |
22521 |
The AutoMode value is out of the range of the device used. |
22522 |
The TransferSize value is out of the range of the device used. |
The initial value for all devices is as follows
AutoMode = 1
TransferSize = Since the transfer size is set automatically, it varies depending on the device.
AI-1664UG-PE |
1 |
Set the transfer size for one transfer in user buffer mode.
When the transfer size is set automatically, the transfer size automatically set by the device driver differs depending on the clock type.
For internal clock |
A transfer size is set according to the sampling clock period. |
||||||
For external clock |
The transfer size is fixed for each device.
|
If you set the transfer size manually, you can set any transfer size in number of packets.
Increasing the transfer size reduces the CPU usage rate and stabilizes operation, but the data transfer interval becomes longer.
Reducing the transfer size shortens the data transfer interval, but the CPU usage rate increases and operation may become unstable.
Depending on the transfer size, the number of transfer data may not advance when the clock is input, but sampling is still performed.
When the transfer is completed, the remaining data will also be transferred.
Cannot be set while sampling is in progress
For automatic setting, the transfer size is fixed at the timing of executing the AioStartAi function.
Even if the sampling clock period is changed during sampling operation, the transfer size will not change.
The set transfer size can be obtained with the AioGetAiTransferSize function.
Sets the transfer size to auto.
C, C++ |
long Ret; |
Python |
Ret = ctypes.c_long() |