ADwin-Gold II
, Manual February 2013
67
Analog Inputs and Outputs
Read_ADC
ADwin
Read_ADC
Read_ADC
returns a converted value from an A/D-converter with 16-bit reso-
lution.
Syntax
#INCLUDE
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
Read_ADC
(
adc_no
)
Parameters
Notes
Read_ADC24
returns a converted value with 12-bit resolution.
See also
,
Valid for
Gold II
Example
Rem Please select the appropriate include for ADbasic /
TiCoBasic
#Include
ADwinGoldII.inc
'for ADbasic
Rem #Include GoldIITiCo.inc 'for TiCoBasic
Event:
'Set multiplexer: ADC1 to channel 3, ADC2 to channel 4
Set_Mux1
(
001b
)
Set_Mux2
(
001b
)
Rem interrupt IO access for MUX settling time
IO_Sleep
(
200
)
Rem use waiting time, except for access to IOs or external
memory
Rem …
Start_Conv
(
11b
)
'Start conversion for both ADCs
Wait_EOC
(
11b
)
'Wait for end of conversion
Par_1
=
Read_ADC
(
1
)
'Read value of ADC1
Par_2
=
Read_ADC
(
2
)
'Read value of ADC2
T11 TiCo
adc_no
Number (1, 2) of the converter to read.
LONG
ret_val
Measurement value in digits which corresponds to
the voltage at the converter’s input.
LONG