Profibus interface
Run_Profibus
ADwin
176
ADwin-Gold II
, Manual February 2013
Run_Profibus
Run_Profibus
exchanges data with the Profibus Slave.
Syntax
#Include
ADwinGoldII.Inc
ret_val
=
Run_Profibus
(
out_pd_arr
[],
out_pd_arr_len
,
in_pd_arr
[],
in_pd_arr_len
,
work_arr
[])
Parameters
Notes
Run_Profibus
should be processed in a program section with low
priority, because of the long processing time. Using the instruction in a
(non-interruptable) high priority process, the communication between
PC and
ADwin
system would be interrupted too long and thus produce
an error message (timeout).
Each array element in
in_pd_arr
[]
and
out_pd_arr
[]
contains a
single data byte only (bits 0…7). Data areas of more than one byte
length are saved in the appropriate number of consecutive array ele-
ments. Example: 5 data areas of 4 byte length are stored in 5
×
4=20 ar-
ray elements.
Valid for
Gold II-Profibus
See also
Example
T11
o u t _ p d _
arr
[]
Array from which the Profibus Slave reads data
and writes them to the Profibus.
ARRAY
LONG
o u t _ p d _
arr_len
Number of output bytes (1…76), the data of which
are read from the array
out_pd_arr
[]
.
The number may not be greater than given in
out_
mod_cnt
with
Init_Profibus
.
LONG
i n _ p d _
arr
[]
Array into which the Profibus-Slave writes data,
which are read by the Profibus.
ARRAY
LONG
i n _ p d _
arr_len
Number of input bytes (1…76), the data of which
are returned in the array
in_pd_arr
[]
.
The number may not be greater than given in
in_
mod_cnt
with
Init_Profibus
.
LONG
work_arr
[]
Array holding data for operation of the Profibus
Slave, see
Init_Profibus
.
ARRAY
LONG
ret_val
Bit pattern holding the state of operation of the
Profibus Slave. Only bits Bits 0…2 are important:
100b
: Slave is active and runs correcty.
010b
: Profibus inactive, Slave is waiting.
110b
,
111b
: Error.
LONG