Digital Inputs and Outputs
Digin_FIFO_Read_Timer
ADwin
96
ADwin-Gold II
, Manual February 2013
Digin_FIFO_
Read_Timer
Digin_FIFO_Read_Timer
returns the current status of the 100MHz timer.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
Digin_FIFO_Read_Timer
()
Parameters
Notes
The module timer is used to provide time stamps for the edge detection
unit, see
Digin_FIFO_Enable
.
The timer value is increased every 10 ns by 1, so the timer will reach the
original timer value after about 43 seconds (= 10ns
×
2
32
). For compa-
rison of time this "overflow" must be considered, so the timer value must
be queried regularly in the program before a overflow has happened.
See also
,
Valid for
Gold II
Example
Rem Please select the appropriate include for ADbasic / TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Dim
start
,
diff
,
count
As
Long
Init:
count
=
0
start
=
Digin_FIFO_Read_Timer
()
Event:
Rem count number of counter overflows
If
(
Digin_FIFO_Read_Timer
()
<
start
)
Then
Inc
(
count
)
start
=
Digin_FIFO_Read_Timer
()
EndIf
T11 TiCo
ret_val
Current value (-2
31
-1 … 2
31
) of the 100MHz timer.
LONG