Digital Inputs and Outputs
Digin_Edge
ADwin
90
ADwin-Gold II
, Manual February 2013
Digin_Edge
Digin_Edge
returns whether a positive or negative edge has occurred on
digital inputs.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
ret_val
=
Digin_Edge
(
edge
)
Parameters
Notes
A set bit in
ret_val
means, that a selected edge has been occurred at
least once at the digital input since the previous query. Bit for output
channels always return zero.
A query with
Digin_Edge
resets all bits to zero.
See also
,
Valid for
Gold II
Example
Rem Please select the appropriate include for ADbasic / TiCoBasic
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Init:
Conf_DIO
(
1100b
)
'channels 0:15 as inputs
Event:
Rem check positive and negative edges, mask out outputs
Par_1
=
Digin_Edge
(
1
)
And
0Fh
Par_2
=
Digin_Edge
(
0
)
And
0Fh
Rem output edge changes
If
(
Par_1
+
Par_2
>
0
)
Then
Digout_Bits
(
Shift_Left
(
Par_1
,
16
),
Shift_Left
(
Par_2
,
16
))
EndIf
T11 TiCo
edge
Kind of detected edge:
1: Detect positive edge.
0: Detect negative edge.
LONG
ret_val
Bit pattern where each bits represent an edge
occurred at an input. The mapping of bits to inputs
is shown below.
Bit = 1: An edge has occurred.
Bit = 0: No edge occurred.
LONG
Bit no.
31
30
…
2
1
0
Input
31
30
…
2
1
0