ADLINK PCM-9112+ User Manual
Page 57

C/C++ Library
• 49
5.7 _9112_DA
@ Description
This function is used to write data to the D/A converters. There are two
Digital-to-Analog conversion channels on the PCI-9112. The resolution
of each channel is 12-bit, i.e. the range is from 0 to 4095.
@ Syntax
Visual C++(Windows-95)
int W_9112_DA (int card_number, int da_ch_no, unsigned
int data)
Visual Basic (Windows-95)
W_9112_DA (ByVal card_number As Long, ByVal da_ch_no As
Long, ByVal da_data As Long) As Long
C/C++ ( DOS)
int _9112_DA (int card_number, int da_ch_no, unsigned int
data )
@ Argument
card_number:
the card number of PCI-9112
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 bits are negligent.
@ Return Code
ERR_NoError, ERR_BoardNoInit
ERR_InvalidDAChannel
@ Example
#include “9112.h”
main()
{
Int
baseAddr, irqNo;
_9112_Initial( CARD_1, &baseAddr, &irqNo);
/* Assume NoError when Initialize PCI-9112 */
/* if the hardware setting for DA output range is
0~5V */
_9112_DA(CARD_1, DA_CH_1 , 0x800 );
printf( "The output voltage of CH1 is 2.5V \n" );
_9112_DA(CARD_1, DA_CH_2 , 0xFFF );
printf( "The output voltage of CH2 is 5V \n" );
}
A more complete program is specified in Appendix A Demo.
Program 'DA_DEMO.C'