PROFIBUS DP
5.1 CPU 41x-3 PN/DP as DP master / DP slave
S7-400 Automation System, CPU Specifications
Manual, 10/2006, 6ES7498-8AA04-8BA0
5-17
Example of Reading Slave Diagnostic Data, Using FB 192 "IM 308C"
Here, you will find an example of how to use FB 192 to read out the slave diagnostics for a
DP slave in the STEP 5 user program.
Assumptions
For this STEP 5 user program, the following is assumed:
● The IM 308-C operating in DP master mode uses the page frames 0 to 15 (number 0 of
IM 308-C).
● The DP slave is assigned PROFIBUS address 3.
● Slave diagnostics data should be stored in DB 20. You can also use any other data block
for this.
● Slave diagnostic data has a length of 26 bytes.
STEP 5 User Program
Table 5-10 STEP 5 User Program
STL Description
:A DB 30 Default address area for the IM 308-C
:SPA FB 192 IM no. = 0, PROFIBUS address of the DP slave = 3
Name :IM308C Function: Read slave diagnosis
DPAD : KH F800 is not evaluated
IMST : KY 0, 3 S5 data area: DB 20
FCT : KC SD Diagnosis data as of data word 1
GCGR : KM 0 Length of diagnostic data = 26 bytes
TYPE KY 0, 20 Error code storage in the DW 0 of the DB 30
STAD KF +1
LENG KF 26
ERR DW 0