Analog Output

Analog Output of the Specified Channel

Use function AioSingleAo or AioSingleAoEx to analog output from the specified channel.
Function AioSingleAo specifies the conversion data by binary value, and function AioSingleAoEx specifies the conversion data by voltage or current value.

Ret = AioSingleAo ( Id , AoChannel , AoData )

Ret = AioSingleAoEx ( Id , AoChannel , AoData )

In AoChannel, specify the channel for analog output. Since channels are counted like 0, 1, 2, ..., for example, if the total number of analog output channels is 4, the channel that can be specified is 0, 1, 2, 3.

In AoData, specify the analog output data by binary value.
For AioSingleAo, the range of binary value is 0 to 4095 for a 12-bit resolution device and 0 to 65535 for a 16-bit resolution device.
For AioSingleAoEx, specify the analog output data by voltage or current value.

If the device with a relay circuit, the relay circuit of the channel used for conversion is automatically set to the ON state. To turn OFF the relay circuit, please use function AioDisableAo.

Analog Output of Multiple Channels

Use function AioMultiAo or AioMultiAoEx to analog output from multiple channels.
Function AioMultiAo specifies the conversion data by binary value, and function AioMultiAoEx specifies the conversion data by voltage or current value.

Ret = AioMultiAo ( Id , AoChannels , AoData )

Ret = AioMultiAoEx ( Id , AoChannels , AoData )

In AoChannels, specify the number of channels for analog output. Since the output of each channel is done at the same time, it does not make any sense to the channel sequence.

If 4 is specified in AoChannels, channel 0, 1, 2, 3 are converted.
It can not be used to convert channel 0, 2, 4, 6 by specifying 4 in AoChannels.

AoChannels

Channel to be converted

1

0

2

0, 1

3

0, 1, 2

:

:

In AoData, specify the address of the array that stores the output data.
Please ensure the size of array, that must be the number of channels specified by AoChannels.
Array subscript = Output channel data

Array (0)

Output data of Ch0

Array (1)

Output data of Ch1

Array (2)

Output data of Ch2

  :

  :

In AoData array, specify the analog output data by binary value.
For AioMultiAo, the range of binary value is 0 to 4095 for a 12-bit resolution device and 0 to 65535 for a 16-bit resolution device.
For AioMultiAoEx, specify the analog output data by voltage or current value.

For the device with synchronous output function, output is performed simultaneously for the set channels. For devices without synchronous output function, the output is performed in the order of channel 0, 1, 2 with transparent (sequential output).

If the device with a relay circuit, the relay circuit of the channel used for conversion is automatically set to the ON state. To turn OFF the relay circuit, please use function AioDisableAo.

Conversion from Voltage to Binary Value

Analog output functions (AioSingleAo, AioMultiAo) specify the output data by binary value.
The conversion from voltage value to binary value is performed by the following formula.

Binary value = resolution × ( Voltage value - Minimum range value ) ÷ ( Maximum range value - Minimum range value )
The resolution is 4096 for 12-bit, 65535 for 16-bit.

Example) Analog output range : -5 to 5V, Resolution : 12-bit, convert voltage value 2.5V to binary value
Binary value = 4096 × ( 2.5 - (-5) ) ÷ ( 5 - (-5) ) ≒ 3072