Technical data

Table Of Contents
SFCs/SFBs for Transferring Data Records
System Software for S7-300/400 System and Standard Functions - Volume 1/2
A5E00709327-01
7-11
7.7 Writing a Data Record with SFC 58 "WR_REC"
Description
With SFC 58 "WR_REC" (write record), you transfer the data record contained in
RECORD to the addressed module.
You start the write job by assigning the value 1 to the input parameter REQ when
SFC 58 is called. If the write job could be executed immediately, the SFC returns
the value 0 at the output parameter BUSY. If BUSY has the value 1, writing is not
yet completed.
Note
If a DPV1 slave is configured using a GSD file (GSD as of Rev. 3) and the DP
interface of the DP master is set to "
S7 compatible
", then data records must not be
written to the I/O modules in the user program with SFC 58. The reason is that in
this case the DP master addresses the incorrect slot (configured slot +3).
Remedy: Set the interface for the DP master to "DPV1".
Parameter
Declaration
Data
Type
Memory Area
Description
REQ INPUT BOOL I, Q, M, D, L,
constant
REQ = 1: Write request
IOID INPUT BYTE I, Q, M, D, L,
constant
ID of the address area:
B#16#54 = Peripheral input (PI)
B#16#55 = Peripheral output (PQ)
With mixed modules, specify the area ID of
the lowest address. With the same
addresses, specify B#16#54.
LADDR INPUT WORD I, Q, M, D, L,
constant
Logical address of the module. With mixed
modules, specify the lower of the two
addresses.
RECNUM INPUT BYTE I, Q, M, D, L,
constant
Data record number (permitted values: 2 to
240)
RECORD INPUT ANY I, Q, M, D, L Data record. Only the data type BYTE is
permitted.
RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs while the function is
active,
the return value contains an error code.
BUSY OUTPUT BOOL I, Q, M, D, L BUSY = 1: Writing is not yet completed.
Input Parameter RECORD
The data to be transferred are read from the parameter RECORD during the first
SFC call. If the transfer of the data record takes longer than the duration of a call,
the contents of the parameter RECORD are no longer relevant for the subsequent
SFC calls (for the same job).