ADwin-Gold II
, Manual February 2013
63
Analog Inputs and Outputs
ADC
ADwin
ADC
ADC
measures the voltage of an analog input and returns the corresponding
digital value.
Syntax
#INCLUDE
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
ADC
(
channel
)
Parameters
Notes
returns digital values with 24 bit resolution.
ADC
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 to a digital
value.
•
Wait_EOC
: Wait for the end of conversion.
•
Read_ADC
: 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 the instructions
Set_Mux1
/
2
,
Start_Conv
,
Wait_EOC
and
Read_ADC
should be used instead of
ADC
in the follo-
wing cases:
•
Very short cycle times:
Processdelay
< 240 (s.a.).
•
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 (1…16) of the analog input channel.
LONG
ret_val
Measurement value in digits (0…65535).
LONG
Voltage
Digits
32768
bipolar
–
(
)
measurement range
65536
----------------------------------------------
⋅
=
Analog
Inputs
and
Outputs