ADLINK ACL-8216 User Manual

Page 60

Advertising
background image

52 C/C++ Library

5.13 _8216_AD_Acquire

@ Description

This function will set the A/D mode as AD_MODE_1 (Software trigger,
Software polling), generate a software trigger to begin A/D conversion,
then poll the A/D conversion data. It reads the 16-bit A/D data until the
data is ready ('data ready' bit becomes low).

@ Syntax

int _8216_AD_Aquire( int *ad_data )

@ Argument

ad_data:

16-bit A/D converted value, the value

should

within -32768 to 32767

@ Return Code

ERR_NoError
ERR_BoardNoInit
ERR_AD_AquireTimeOut

@ Example

#include “aclerr.h”
#include "8216.h"

main()
{
intad_data;
intErrCode;


_8216_Initial( CARD_1, 0x220 );
/* Assume NoError when Initialize ACL-8216 */

/* Set to software trigger at first*/
/* then trigger the AD */
/* wait for AD data ready then read it */
ErrCode = _8216_AD_Aquire( &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_DEMO.C’.

Advertising