Digi RCM4000 user manual Float anaInVoltsunsigned int channel, unsigned int gaincode

Models: RCM4000

1 124
Download 124 pages 43.01 Kb
Page 60
Image 60

float anaInVolts(unsigned int channel, unsigned int gaincode);

Reads the state of a single-ended analog input channel and uses the previously set calibration constants to convert it to volts.

PARAMETERS

channel is the channel number (0 to 7) corresponding to LN0_IN to LN7_IN

Channel Code

Single-Ended

Voltage Range

Input Lines*

(V)

 

0

+AIN0

0–22.5

 

 

 

1

+AIN1

0–22.5

 

 

 

2

+AIN2

0–22.5

 

 

 

3

+AIN3

0–22.5

 

 

 

4

+AIN4

0–22.5

 

 

 

5

+AIN5

0–22.5

 

 

 

6

+AIN6

0–22.5

 

 

 

7

+AIN7

0–2

* Negative input is ground.

† Applies to Prototyping Board.

‡ Used for thermistor in sample program.

gaincode is the gain code of 0 to 7.

Gain Code

Multiplier

Voltage Range*

(V)

 

 

0

×1

0–22.5

 

 

 

1

×2

0–11.25

 

 

 

2

×4

0–5.6

 

 

 

3

×5

0–4.5

 

 

 

4

×8

0–2.8

 

 

 

5

×10

0–2.25

 

 

 

6

×16

0–1.41

 

 

 

7

×20

0–1.126

 

 

 

* Applies to RCM3400 Prototyping Board.

RETURN VALUE

A voltage value corresponding to the voltage on the analog input channel. ADOVERFLOW (defined macro = -4096) if overflow or out of range.

ADTIMEOUT (defined macro = -4095) if conversion is incomplete or busy-bit timeout.

SEE ALSO

anaInCalib, anaIn, anaInmAmps, brdInit

54

RabbitCore RCM4000

Page 60
Image 60
Digi RCM4000 user manual Float anaInVoltsunsigned int channel, unsigned int gaincode