QUESTION:
Using the system function SFC12 "D_ACT_DP" how can I obtain an
overview of all the enabled and disabled DP slaves?
ANSWER: Using the system function SFC12 "D_ACT_DP"
you can determine the status of a DP slave by specifying a logical
address for the "LADDR" parameter and job ID 0 for the "MODE"
parameter. In order to monitor all the DP slaves of the master
system you have to execute this system function for each DP
slave.
It is better to use the system function SFC51 "RDSYSST" for this
task. Using this system function you can determine the status of
all the slaves of a DP master in one call. The following table
shows the parameters to be assigned in SFC51 for this task.
| I/O
type |
Parameter |
Value |
Type |
Meaning |
| I |
REQ |
True |
BOOL |
Trigger processing with TRUE |
| I |
SZL_ID |
W#16#0692 |
WORD |
OK status of all the DP slaves |
| I |
INDEX |
B#16#1 |
WORD |
Number of the master system, e.g. 1 |
| O |
RET_VAL |
|
INT |
Return value |
| O |
BUSY |
|
BOOL |
Processing still in progress |
| O |
SZL_HEADER |
|
STRUCT |
|
| O |
DR |
|
ANY |
Target area for data determined |
Table 1: Parameters of system function SFC51
Notes on the parameters in Table 1:
REQ:
System function SFC51 is an asynchronous function, i.e. processing
can take several cycles. Therefore, before calling the function
again you should evaluate the BUSY parameter. Only if this is not
set can you start a new job.
SZL_ID:
The value specified in Table 1 is valid only for master systems on
integrated DP interface modules. For external DP interface modules
(e.g. CP443-5 Ext.) you have to use the value W#16#4692.
INDEX:
You get the value for this parameter from the Hardware
Configuration (PROFIBUS(x); DP master system(1)).
SZL_HEADER:
You do not need this parameter, but you must declare it. The
STRUCT variable to be transferred to this parameter consists of two
WORD variables.
DR:
For this parameter you specify the variable for the data
determined. In this application case the variable must be an ARRAY
OF BYTES [1...16]. There is a bit reserved in this ARRAY for each
DP slave (16 x 8 = 128). The status of the DP slave with Address 1
is in Bit 0 of the first byte. If this bit is set, then that DP
slave is either defective or disabled.
Note:
More detailed information on system function SFC51 is available in
the STEP 7 Online Help or by going to Start > SIMATIC >
DOCUMENTATION and selecting the manual "System Software for
S7-300/400 System and Standard Functions", which is also available
in Entry ID: 1214574.
|