AioSetAoAttachedData


Function

Sets the attached data that are attached to the DA conversion data.
This function can only be used for the device with the bus-master transfer functionality.

This function is available when the transfer mode of the conversion data is set to the user buffer mode by AioSetAoTransferMode function. 
This function cannot be used when the transfer mode of the conversion data is the device buffer.

Format

Ret = AioSetAoAttachedData ( Id , AttachedData )

Parameters

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

AttachedData [ C : long ]
Specifies the type of the attached data that are attached to the DA 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

Digital output data

AOAT_DO

00000001H

Return value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ]

0

Normality completion

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

See also: Error code details

Initial value

In all devices, AttachedData= 0

Remarks

you can select the following attached data as the data that are attached to the DA conversion data.

1.  Digital input and output
Digital input and output and DA conversion is performed at that time.
Bit0:Digital Input Bit0
Bit1:Digital Input Bit1
Bit2:Digital Input Bit2
Bit3:Digital Input Bit3
The other bits: Not used

The conversion data with the attached data are transferred to the user buffer memory.
All of the attached data use the buffer of 4 bytes (1 packet).

Please note that the necessary number of packets may be different according to the setting for the attached data.
If you use AioGetAoSamplingDataSize function, the number of packets for one sampling can be retrieved. 

This function cannot be used on devices without the analog output function.
If the device is in operation, the function cannot be performed.

Example

Sets the digital input and output data to the attached data.

C

Ret = AioSetAoAttachedData ( Id , AOAT_DO);