ADLINK ACL-8216 User Manual
Page 54

46 • C/C++ Library
printf( "The high byte is now 0xAA.\n" );
}
A more detailed example program is provided.
('DO_DEMO.C')
5.7 _8216_DA
@Description
This function is used to write data to D/A converters. There are two
Digital-to-Analog conversion channels on the ACL-8216. The
resolution of each channel is 12-bit, i.e. the range is from 0 to 4095.
@ Syntax
int _8216_DA(int da_ch_no, unsigned int data )
@ Argument
da_ch_no:
D/A channel number
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 "8216.h"
main()
{
_8216_Initial( CARD_1, 0x220 );
/* Assume NoError when Initialize ACL-8216 */
/* If the hardware setting for DA output is 0~5V
*/
_8216_DA( CH_1 , 0x800 );
printf( "The output voltage of CH1 is 2.5V.\n" );
_8216_DA( CH_2 , 0xFFF );
printf( " The output voltage of CH2 is 5V.\n" );
}
A more detailed example program is provided.
('DA_DEMO.C')