ADwin-Gold II
, Manual February 2013
95
Digital Inputs and Outputs
Digin_FIFO_Read
ADwin
Digin_FIFO_Read
Digin_FIFO_Read
reads the value pairs from the FIFO of the edge detection
unit and writes them into 2 arrays.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Digin_FIFO_Read
(
value_by_ref
,
timestamp_by_ref
)
Parameters
Notes
Before reading there must be a check with
Digin_FIFO_Full
, if there
is at least one value pair saved in the FIFO.
The passed parameters must be variables, not constants.
The time difference between 2 level status patterns is the difference of
the appropriate time stamps, measured in units of 10ns:
See also
,
Valid for
Gold II
Example
Rem Please select the appropriate include for ADbasic / TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Dim
Data_1
[
10000
],
Data_2
[
10000
]
As
Long
Dim
num
,
index
As
Long
Init:
Conf_DIO
(
1100b
)
'channels 0:15 as inputs
Digin_FIFO_Enable
(
0
)
'edge control off
Digin_FIFO_Clear
()
'clear FIFO
Digin_FIFO_Enable
(
10011b
)
'control channels 1,2,5
index
=
1
Event:
If
(
Digin_FIFO_Full
()>
0
)
Then
Rem read one value pair
Digin_FIFO_Read
(
Data_1
[
index
],
Data_2
[
index
])
index
=
index
+
1
If
(
index
>
10000
)
Then
index
=
1
EndIf
T11 TiCo
value_ by_
ref
Array where the level status bit patterns are writ-
ten.
Each level status bit corresponds to a digital input
(see table below).
LONG
timest amp
_by_ref
Array where time stamps are written.
LONG
Bit no.
31
30
…
2
1
0
Input
31
30
…
2
1
0
Δ
t
stamp
1
stamp
2
–
(
)
10 ns
⋅
=