QUESTION:
Which parameters do I have to assign to the system functions SFC103
"DP_TOPOL" and SFC59 "RD_REC" to be able to identify and read out
the topology data of a diagnostics repeater (DR)?
ANSWER: The system function SFC103 "DP_TOPOL" triggers
identifying of the topology for a selected DP master system. In
order to be able to use this system function your CPU has to meet
certain requirements. These are given in detail in Entry ID:
17452619.
An SFC103 call addresses all diagnostics repeaters on a DP
master system.
|
Parameter |
Meaning |
Data type |
I/O |
|
REQ |
Trigger identifying of topology |
BOOL |
I |
|
R |
Abort identifying of topology |
BOOL |
I |
|
DP_ID |
ID of the DP master system whose topology is to be identified
(see Fig. 1) |
INT |
I |
|
RET_VAL |
Return value of the job status |
INT |
O |
|
BUSY |
Identifying of topology not yet finished |
BOOL |
O |
|
DPR |
PROFIBUS address of the diagnostics repeater reporting the
error |
BYTE |
O |
|
DPRI |
Measuring segment of the diagnostics repeater reporting the
error |
BYTE |
O |
Table 1: Calling parameters of the SFC103 "DP_TOPOL" -
identifying of topology
When SFC59 "RD_REC" is called, the data stored in a diagnostics
repeater is read out. The volume of the data that can be read out
by a SFC59 call is limited to 240 bytes. The diagnostics repeater
however provides 675 bytes of data only for the topology. The
topology data in the diagnostics repeater is therefore stored in 4
different data records which are only 170 or 165 bytes in size.
Thus with four calls of the SFC59 all the topology data of a
diagnostics repeater can be read out.
|
Parameter |
Meaning |
Data type |
I/O |
|
REQ |
Request to read a data record |
BOOL |
I |
|
IOID |
ID of the address area - the DR is configured as peripheral
input (PI) (B#16#54) |
BYTE |
I |
|
LADDR |
Logical address of the module - the diagnostics address is to be
used with the DR (see Fig. 1) |
WORD |
I |
|
RECNUM |
Data record number (valid values for the identifying of topology
data 32h...35h for the data records 50...53) |
BYTE |
I |
|
RET_VAL |
If an error occurs during processing of the function, the return
value contains an error code. In addition: length of the data
record actually transferred in bytes (possible values: 165 or 170),
if the target area is greater than the data record transferred and
if no error occurs during the transfer. |
INT |
O |
|
BUSY |
The read procedure has not yet finished |
BOOL |
O |
|
RECORD |
Target area for the data record read |
BYTE |
O |
Table 2: Parameters of the SFC59 "RD_REC" - read data record
Fig. 1: Parameters from the HW Config
required for the SFC103 and SFC59 call ( 56 KB )
Recommendation for Programming:
The structure of four data records of the topology table is
identical. If you create an UDT, in which the structure is
determined uniquely, then you can use this UDT several times when
specifying the structure of the required data block. This saves you
creating the data structure time and again for every data block. In
case of changes only the UDT is to be changed.
Note:
More information on this topic is available in the STEP 7 Online
Help or in section 13.7 "Identifying the Bus Topology in a DP
Master System with SFC 103 DP_TOPOL" of the manual "SIMATIC System
Software for S7-300/S7-400 System and Standard Functions". The
manual is available in Entry ID: 1214574.
|