Sets the attached data that are attached to the AD conversion data.
This function is available when the transfer
mode of the conversion data is set to the user buffer mode by AioSetAiTransferMode
function.
This function cannot be used when the transfer mode of the conversion data
is the device buffer.
Ret = AioSetAiAttachedData ( Id , AttachedData )
Id
[ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short
]
Specifies the ID retrieved from AioInit function.
AttachedData
[ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ Python : ctypes.c_long
]
Specifies the type of the attached data that are attached to the AD conversion
data from the following range in macro or value.
AttachedData is used in bit, so they can be combined to use.
Attached data |
Macro |
Value |
Attached information of analog input |
AIAT_AI |
00000001H |
Data of analog output |
AIAT_AO0 |
00000100H |
Data of digital input and output |
AIAT_DIO0 |
00010000H |
Data of counter channel 0 |
AIAT_CNT0 |
00100000H |
Data of counter channel 1 |
AIAT_CNT1 |
00200000H |
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 |
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 |
In all devices, AttachedData = 0
The following attached data can be selected as the data that are attached to the AD conversion data.
Attached data is transferred to user memory
together with AD conversion data.
Attached data uses a buffer of 4 bytes (1 packet) for all types.
Therefore, please note that the number of
packets required for one sampling changes depending on the specified status
of attached data.
Use the AioGetAiSamplingDataSize
function to get the required number of packets per sampling.
If the device is in operation, the function
cannot be performed.
â– Transfer image of attached data
Attached data follows AD conversion data.
They are transferred in the following order.
1. Attached information of analog input
2. Data of analog output
3. Data of digital input and output
4. Data of counter channel 0
5. Data of counter channel 1
Regardless of the type of attached data you use, data with the lowest number is transferred first.
For details on each attached data, please
refer to the topic "Data
attached to AD conversion data" in the glossary.
AIO-163202F-PE ADA16-32/2(PCI)F AIO-163202G-PE |
Support the following 5 types of attached data. 1. Attached information of analog input 2. Data of analog output 3. Data of digital input and output 4. Data of counter channel 0 5. Data of counter channel 1 |
AI-1664UG-PE |
Support the following 3 types of attached data. 1. Attached information of analog input 2. Data of digital input and output 3. Data of counter channel 0 |
AI-1204Z-PE |
The device can specify user buffer mode, but it does not support this API. |
Sets the attached information of analog input to the attached data.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |