
ADwin-Gold II
, Manual February 2013
65
Analog Inputs and Outputs
ADC24
ADwin
ADC24
ADC24
measures the voltage of an analog input and returns the corresponding
digital value. The return value has 24 bit resolution.
Syntax
#INCLUDE
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
ADC24
(
channel
)
Parameters
Notes
returns measurement values with 16 bit resolution.
The return value of
ADC24
contains an 18 bit measurement value in bits
6…23; bits 0…5 are always zero (see also
ADC24
is a combination of consecutive functions:
•
Set_Mux1
,
Set_Mux2
: Set the multiplexer to the specified input
channel.
•
Wait for settling of the multiplexer.
•
Start_Conv
: Start measurement: Convert analog signal-
considering the gain factor-to a digital value.
•
Wait_EOC
: Wait for the end of conversion.
•
Read_ADC24
: Read out digital value from the register and return it.
Multiplexer settling time and conversion time are given on
If you indicate a non-existing input channel the measurement result will
be undefined.
In the following examples you should use the instructions
Set_Mux1
/
2
,
Start_Conv
,
Wait_EOC
and
READADC24
instead of
ADC24
in the fol-
lowing cases:
•
Very short cycle times:
Processdelay
< 200:
ADC12
cannot be
executed during the cycle time.
•
High internal resistance (>3k
Ω
) of the voltage source of the
measurement signal: This increases the settling time of multiplexer.
•
You want to use inevitable waiting times for additional program tasks.
With the following formula you can calculate the measured voltage from
the returned digital value:
The measurement range is 20 Volt here (input voltage range: -
10V…10V).
See also
,
Valid for
Gold II
T11 TiCo
channel
number of the analog input channel (1…16).
LONG
ret_val
measurement result in digits:
(0…16,777,215 = 2
24
-1 ).
LONG
Bit no.
31…24
23…6
05…00
Content
0
18 bit meas. value
0
Voltage
Digits
8388608
bipolar
–
(
)
measurement range
16777216
----------------------------------------------
⋅
=