Technical data

Table Of Contents
SFCs/SFBs for Transferring Data Records
System Software for S7-300/400 System and Standard Functions - Volume 1/2
7-18
A5E00709327-01
7.10 Reading Predefined Parameters with SFB 81
"RD_DPAR"
Description
SFB 81 "RD_DPAR" (read device parameter) lets you read the data record with the
INDEX number of the component addressed from the system data configured with
STEP 7. This can be a centrally inserted module or a distributed component
(PROFIBUS DP or PROFINET IO).
The value TRUE for the VALID output parameter indicates that the data record was
successfully transferred to the RECORD destination area. In this case, the LEN
output parameter contains the length of the read data in bytes.
If an error occurred during transfer of the data record, this is indicated by the output
parameter ERROR. In this case, the output parameter STATUS contains the error
information.
Function
The SFB 81 "RD_DPAR" operates asynchronously; that is, the processing extends
over several SFB calls. To start the data transfer, call SFB 81 with REQ = 1.
The output parameter BUSY and bytes 2 and 3 of the output parameter STATUS
show the status of the job. Bytes 2 and 3 of STATUS correspond to the output
parameter RET_VAL of asynchronously operating SFCs (see also Meaning of the
Parameters REQ, RET_VAL and BUSY with Asynchronous SFCs
The transfer of the data record is complete when the output parameter BUSY has
the value FALSE.
Parameters
Parameter Declaration Data Type Memory Area Description
REQ INPUT BOOL E, A, M, D, L REQ = 1: Read request
LADDR INPUT WORD I, Q, M, D, L,
constant
Any logical address of the module
In bit 15 you indicate whether an input
address (bit 15 = 0) or an output address
(bit 15 = 1) is present.
INDEX INPUT INT I, Q, M, D, L,
constant
Data record number
VALID OUTPUT BOOL I, Q, M, D, L New data record was received and valid
BUSY OUTPUT BOOL I, Q, M, D, L BUSY = 1: The job is not terminated.
ERROR OUTPUT BOOL I, Q, M, D, L ERROR = 1: An error occurred during the
read process.
STATUS OUTPUT DWORD I, Q, M, D, L Call ID (bytes 2 and 3) or error code
LEN OUTPUT INT I, Q, M, D, L Length of the read data record information
RECORD IN_OUT ANY I, Q, M, D, L Target area for the read data record
Error Information
See Assigning Parameters to a Module with SFC 57 "PARM_MOD"