The frequently used FB125 DP_DIA function block and the associated visualization have been replaced by the PNIODiag diagnostic package as per Jan. 01, 2008.
The FB126 "PNIODiag" is available for free downloading from the Internet under the following entry ID: 26996747.
But the following is not a good message.
The used S7 data block s as well as the S7 function blocks doesn't contain any symbolic information. An interface description isn't available. The S7 blocks are only made for usage by the visualisation that are part of the diagnosis package PNIODiag.
I need to make a diagnostic of every node and to generate a "communication alarm" in the Step 7 program for every node. If I use it in automatic mode I can't know which nodes are down in the case of there are more than 1 node in alarm. I need the symbolic information of the instance data block of FB126.
See this example of S7 without using the profibus diagnostic pakage,
very easy and more fast.
You have need only a SFC51 diagnostic and SFC 20 Block move!
Have a nice day.
// information about the state of the DP slaves of the PROFIBUS DP master system
CALL "RDSYSST"
REQ :=TRUE
SZL_ID :=W#16#694 //SZL_ID for the state of the DP slaves
INDEX :=W#16#1 //number of the DP master system (hexadecimal)
RET_VAL :=MW32
BUSY :=M29.1
SZL_HEADER:="DIAG_STRUCT".STAT0
DR :=P#DB61.DBX0.0 BYTE 258 //data record with diagnostic information
//information about the state of the IO devices of the PROFINET-IO system
CALL "RDSYSST"
REQ :=TRUE
SZL_ID :=W#16#694 //SZL_ID for the state of the IO devices
INDEX :=W#16#64 //number of the PROFINET-IO system (hexadecimal)
RET_VAL :=MW30
BUSY :=M29.0
SZL_HEADER:="DIAG_STRUCT".STAT0
DR :=P#DB60.DBX0.0 BYTE 258 //data record with diagnostic information
//DB51 - "DIAG_STRUCT"
STAT0 STRUCT
STAT1 WORD W#16#0
STAT2 WORD W#16#0
END_STRUCT
//DB60
index WORD W#16#0
Device_status ARRAY[0..2048]
BOOL
//DB61
index WORD W#16#0
Slave_status ARRAY[0..2048]
BOOL