Analog Inputs and Outputs
Read_ADC24
ADwin
68
ADwin-Gold II
, Manual February 2013
Read_ADC24
Read_ADC24
returns a converted value from an A/D-converter with 24-bit
resolution.
Syntax
#INCLUDE
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
Read_ADC24
(
adc_no
)
Parameters
Notes
Read_ADC
returns a converted value with 16-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
Dim
val1
,
val2
As
Long
Event:
'Set multiplexer: ADC12-1 to channel 3, ADC12-2 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
val1
=
Read_ADC24
(
1
)
'Read value of ADC1
val2
=
Read_ADC24
(
2
)
'Read value of ADC2
T11 TiCo
adc_no
Number (1, 2) of the converter to read.
LONG
ret_val
Measurement value in digits (0…16,777,215 =
2
24
-1 ), which corresponds to the voltage at the
converter’s input.
LONG