ADLINK ACL-8112 Series User Manual

Page 68

Advertising
background image

60

• C Language Library

7.6

_8112_DA

Description

This function is used to write data to the D/A converter. There are two
Digital-to-Analog conversion channels on the ACL-8112. The resolution
of each channel is 12-bit, thus the digital data ranges is from 0 to 4095.

Syntax

int _8112_DA(int da_ch_no, unsigned int data )
int _8112pg_DA(int da_ch_no, unsigned int data )

Argument:

da_ch_no: D/A channel number, DA_CH_1 or DA_CH_2.
data: D/A converted value, if the value is greater

than

4095, the higher 4-bits are negligent.

Return Code:

ERR_NoError
ERR_BoardNoInit
ERR_InvalidDAChannel

Example:

#include “8112.h”

main()
{

_8112_Initial( CARD_1, A8112B_DG, 0x220 );

/* Assume NoError when Initialize ACL-8112 */
/* if the hardware setting for DA output range
is 0~5V */

_8112_DA( DA_CH_1 , 0x800 );
printf( "The output voltage of CH1 is 2.5V \n" );

_8112_DA( DA_CH_2 , 0xFFF );
printf( "The output voltage of CH2 is 5V \n" );

}A more complete program is provided in this software.
'DA_DEMO.C'

Advertising