ADwin-Gold II
, Manual February 2013
183
EtherCAT interface
ECAT_Init
ADwin
ECAT_Init
ECAT_Init
initializes the EtherCAT interface.
Syntax
#Include
ADwinGoldII.inc
ret_val
=
ECAT_Init
(
in_mod_cnt
,
in_mod_type
,
out_mod_cnt
,
out_mod_type
,
work_arr
[],
info
[])
Parameters
Notes
This instruction must be processed before working with the EtherCAT in-
terface.
ECAT_Init
should be processed in a program section with low priority,
because of the long processing time (about 2-3 seconds). Using the in-
struction in a (non-interruptable) high priority process, the communica-
tion between PC and
ADwin
system would be interrupted too long and
thus produce an error message (timeout).
If you configure the interface externally (e.g. using the program Twin-
CAT System Manager), you still have to configure the interface in
AD-
basic
and use the very same settings.
Valid for
Gold II-EtherCAT
T11
i n _ m o d _
cnt
Number (1…254) of input areas in the EtherCAT
interface. The max. number depends on
in_mod_
type
.
LONG
i n _ m o d _
type
Key number (1…3, 16) for the length of input
areas:
1: 1 Byte; max. value for
in_mod_cnt
: 254.
2: 2 Byte; max. value for
in_mod_cnt
: 127.
3: 4 Byte; max. value for
in_mod_cnt
: 63.
16:8 Byte; max. value for
in_mod_cnt
: 31.
LONG
o u t _ m o d _
cnt
Number (1…254) of output areas in the EtherCAT
interface. The max. number depends on
out_
mod_type
.
LONG
o u t _ m o d _
type
Key number (1…3, 16) for the length of output
areas:
1: 1 Byte; max. value for
out_mod_type
: 254.
2: 2 Byte; max. value for
out_mod_type
: 127.
3: 4 Byte; max. value for
out_mod_type
: 63.
16:8 Byte; max. value for
out_mod_type
: 31.
LONG
work_arr
[]
Array to store data for operation of the EtherCAT
interface. The array must have at least 200 ele-
ments.
ARRAY
LONG
info
[]
Array holding data about the EtherCAT interface.
The array must have at least 10 elements.
The elements
info
[
1
]
and
info
[
2
]
contain the
production type of the EtherCAT interface:
info
[
1
]
=1,
info
[
2
]
=4
ARRAY
LONG
ret_val
State of initialization:
0: no error.
≠
0: Error; please contact the support of Jäger
Messtechnik.
LONG