101BExtended instructions
8.3 Distributed I/O (PROFINET, PROFIBUS, or AS-i)
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
271
Refer to "Extended instructions, Distributed I/O: Error information for RDREC, WRREC, and
RALRM" (Page 265) for more information on general error codes.
Note
If you access DPV1 slaves, error information from these slaves can be forwarded from the
DP master to the instruction.
8.3.5
DPNRM_DG
You can use the DPNRM_DG (Read diagnostic data) instruction with PROFIBUS.
Table 8- 82 DPNRM_DG instruction
LAD / FBD SCL
Description
ret_val := DPNRM_DG(
req:=_bool_in_,
laddr:=_word_in_,
record=>_variant_out_,
busy=>_bool_out_);
Use the DPNRM_DG instruction to 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.
Table 8- 83 DPNRM_DG instruction data types for the parameters
Parameter and type
Data type
Description
REQ
IN
Bool
REQ=1: Read request
LADDR
IN
HW_DPSLAVE Configured diagnostic address of the DP slave: Must be the address of
the station and not for the I/O device. Select the station (and not the
image of the device) in the "Network" view of the "Device configuration"
to determine the diagnostic address.
Enter the addresses in hexadecimal format. For example, diagnostic
address 1022 means LADDR:=W#16#3FE.
RET_VAL
OUT
Int
If an error occurs while the function is active, the return value contains
an error code. If no error occurs, the length of the data actually
transferred is entered in RET_VAL.
RECORD
OUT
Variant
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
OUT
Bool
BUSY=1: The read job is not yet completed
You start the read job by assigning 1 to the input parameter REQ in the DPNRM_DG
instruction call. The read job is executed asynchronously, in other words, it requires several
DPNRM_DG instruction calls. The status of the job is indicated by the output parameters
RET_VAL and BUSY.