Professional Documents
Culture Documents
15.3
Slave Diagnostics
Each DP slave provides slave diagnostic data structured in accordance with EN 50 170 Volume 2, PROFIBUS. To read out this diagnostic data, you require SFC13 "DPNRM_DG." Refer to the following table for the basic structure of the slave diagnostic data and to the manuals of the DP slaves for further information.
Byte 0 1 2 3 4 5 6 ... Meaning Station status 1 Station status 2 Station status 3 Master station number Vendor ID (high byte) Vendor ID (low byte) Further slave-specific diagnostic information
Description
With SFC13 "DPNRM_DG" (read diagnostic data of a DP slave), you read the current diagnostic data of a DP slave in the format specified by EN 50 170 Volume 2, PROFIBUS. The data that has been read is entered in the destination area indicated by RECORD following error-free data transfer. You start the read job by assigning 1 to the input parameter REQ in the SFC13 call.
Function
The read job is executed asynchronously, in other words it requires several SFC13 calls. The status of the job is indicated by the output parameters RET_VAL and BUSY, see Section 2.2.
Parameter REQ LADDR RET_VAL Declaration Data Type Memory Area Description INPUT BOOL I, Q, M, D, L, REQ=1: Read request constant INPUT WORD I, Q, M, D, L, Configured diagnostic address of the DP slave. constant OUTPUT INT I, Q, M, D, L If an error occurs while the function is active, the return value contains an error code. If no error occurred, the length of the data actually transferred is entered in RET_VAL.
15-9
RECORD
OUTPUT
ANY
I, Q, M, D, L
BUSY
OUTPUT
BOOL
I, Q, M, D, L
Destination area for the diagnostic data that were read. Only the BYTE data type is permitted. The minimum length of the data record to be read or the destination area is 6. The maximum length of the data record to be sent is 240. Standard slaves can provide more than 240 bytes of diagnostic data up to a maximum of 244 bytes. In this case, the first 240 bytes are transferred to the destination area and the overflow bit is set in the data. BUSY=1: The read job is not yet completed.
15-10
Error Information
How you evaluate the error information of the RET_VAL parameter is explained in Chapter 2. This chapter also contains the general error information for the SFCs. The error information specific to SFC13 is a subset of the error information for SFC59 "RD_REC," see Table 7-2 Specific Error Information for SFC58 "WR_REC" and SFC59 "RD_REC."
15-11