Profibus interface
Init_Profibus
ADwin
174
ADwin-Gold II
, Manual February 2013
Init_Profibus
Init_Profibus
initializes the Profibus Slave.
Syntax
#Include
ADwinGoldII.Inc
ret_val
=
Init_Profibus
(
dev_adr
,
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 Profibus Slave.
Init_Profibus
should be processed in a program section with low
priority, because of the long processing time (about 2-3 seconds). Using
the instruction in a (non-interruptable) high priority process, the commu-
nication between PC and
ADwin
system would be interrupted too long
and thus produce an error message (timeout).
Station address, number and length of modules must equal the project
settings of the profibus. For projecting, the module length is also given
in words: 1 word = 2 byte.
T11
dev_adr
Slave node address / station address (1…125) on
the Profibus.
LONG
i n _ m o d _
cnt
Number (0…76) of input areas in the Profibus
Slave. 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
: 76.
2: 2 Byte; max. value for
in_mod_cnt
: 38.
3: 4 Byte; max. value for
in_mod_cnt
: 19.
16:8 Byte; max. value for
in_mod_cnt
: 9.
LONG
o u t _ m o d _
cnt
Number (0…76) of output areas in the Profibus
Slave. 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
: 76.
2: 2 Byte; max. value for
out_mod_type
: 38.
3: 4 Byte; max. value for
out_mod_type
: 19.
16:8 Byte; max. value for
out_mod_type
: 9.
LONG
work_arr
[]
Array to store data for operation of the Profibus
Slave. The array must have at least 200 elements.
ARRAY
LONG
info
[]
Array holding data about the Profibus Slave. The
array must have at least 10 elements.
The elements
info
[
1
]
and
info
[
2
]
contain the
production type of the Profibus Slave:
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