ADLINK ACL-8216 User Manual

Page 57

Advertising
background image

C/C++ Library 49

5.10 _8216_AD_Set_Range

@ Description

This function is used to set the A/D range by means of writing data to
the A/D range control register. There are two factors will change the
analog input range- Gain and Input type. The Gain can be choice from
1,2,4 and 8. The initial value of gain is '1' which is set by the ACL-8216
hardware. The relationship between analog input range and gain is
specified by following tables:

Input
Range (V)

Gain Range

Code

±5 V

X 1

0

±2.5 V

X 2

1

±1.25 V

X 4

2

±0.625 V

X 8

3

@ Syntax

int _8216_AD_Set_Range( int range_code )

@ Argument

range_code:

the programmable range of A/D

conversion, the possible values.

@ Return Code

ERR_NoError
ERR_BoardNoInit
ERR_AD_InvalidGain

@ Example

#include "8216.h"

main()
{

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

_8216_AD_Set_Range( 1 );
printf( "The A/D analog input range is +/-5V.\n" );

}

Advertising