ADLINK PCM-9112+ User Manual
Page 63

C/C++ Library
• 55
@ Argument
card_number:
the card number of PCI-9112
ad_data: 12-bit A/D converted value, the value should
be within 0 to 4095.
Bit 0 ~ Bit 3: is the converted channel number
Bit 4 ~ Bit 15: is the converted A/D data.
@ Return Code:
ERR_NoError, ERR_BoardNoInit
ERR_AD_AquireTimeOut
@ Example
#include “9112.h”
main()
{
int ad_data;
int errCode;
Int baseAddr, irqNo;
_9112_Initial( CARD_1, &baseAddr, &irqNo);
/* Assume NoError when Initialize PCI-9112 */
/* Set to software trigger at first*/
_9112_AD_Set_Mode(CARD_1, AD_MODE_0 );
/* then trigger the AD */
_9112_AD_Soft_Trig(CARD_1);
/* wait for AD data ready then read it */
errCode = _9112_AD_Aquire(CARD_1, &ad_data);
if( errCode == ERR_NoError )
printf( "The AD value is %d.\n", ad_data );
else
printf( "AD conversion error happen\n" );
} Also See Demo Program 'AD_DEMO1.C'