Analog Inputs and Outputs
Seq_Set_Gain
ADwin
82
ADwin-Gold II
, Manual February 2013
Seq_Set_Gain
Seq_Set_Gain
sets the gain factor of the sequential control for one ADC.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Seq_Set_Gain
(
adc_no
,
gain
)
Parameters
Notes
The instruction is useful only, if the sequential control is enabled with
Seq_Mode
.
See also
,
,
,
Valid for
Gold II
Example
Rem Please select the appropriate include for ADbasic / TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Dim
Data_1
[
16
]
As
Long
At
DM_Local
Dim
i
As
Long
Init:
Rem settings for sequential control of ADC 2
Seq_Mode
(
2
,
2
)
'continuous mode
Seq_Set_Delay
(
2
,
125
)
'waiting time 4.5 µs (125*20ns + 2µs)
Seq_Set_Gain
(
2
,
0
)
'gain factor 1
Rem select all channels. selection is valid only for active
Rem sequential control 2 = even numbered channels.
Seq_Select
(
0FFFFh
)
Rem start sequential control of ADC2
Seq_Start
(
10b
)
Event:
Rem read current values of even channels
For
i
=
2
To
16
Step
2
Data_1
[
i
]
=
Seq_Read
(
i
)
Next
i
Finish:
Seq_Mode
(
2
,
0
)
'reset to standard mode
T11 TiCo
adc_no
Number (1, 2) of the ADC.
LONG
gain
Gain factor (with active sequential control only):
0 factor = 1, voltage range -10V…+10V.
1 factor = 2, voltage range -5V…+5V.
2 factor = 4, voltage range -2.5V…+2.5V.
3 factor = 8, voltage range 1.25V…+1.25V.
LONG