Extended instructions
9.10 Data block control
S7-1200 Programmable controller
538 System Manual, V4.2, 09/2016, A5E02486680-AK
READ_DBL and WRIT_DBL (Read/write a data block in load memory)
instructions
Table 9- 220 READ_DBL and WRIT_DBL instructions
req:=_bool_in_,
srcblk:=_variant_in_,
busy=>_bool_out_,
dstblk=>_variant_out_);
Copies DB start values or part of the
values, from load memory to a target
DB in the work memory.
The content of load memory is not
changed during the copy process.
req:=_bool_in_,
srcblk:=_variant_in_,
busy=>_bool_out_,
dstblk=>_variant_out_);
Copies DB current values or part of the
values from work memory to a target
DB in load memory.
The content of work memory is not
changed during the copy process.
Table 9- 221 Data types for the parameters
A high signal starts the operation, if BUSY = 0.
SRCBLK IN VARIANT READ_DBL: Pointer to the source data block in load memory
WRIT_DBL: Pointer to the source data block in work memory
BUSY = 1 signals that the reading/writing process is not complete.
DSTBLK OUT VARIANT READ_DBL: Pointer to the destination data block in work memory
WRIT_DBL: Pointer to the destination data block in load memory
Typically, a DB is stored in both load memory (flash) and work memory (RAM). The start
values (initial values) are always stored in load memory, and the current values are always
stored in work memory. READ_DBL can be used to copy a set of start values from load
memory to the current values of a DB in work memory that is referenced by your program.
You can use WRIT_DBL to update the start values stored in internal load memory or
memory card from current values in work memory.
Note
Effect of WRIT_DBL and READ_DBL instruction on flash memory
The WRIT_DBL instruction performs write operations in flash memory (internal load
memory
or memory card). To avoid reducing the lifetime of the flash memory, use the WRIT_DBL
instruction for infrequent updates such as recording changes to a production process. For
similar reasons, avoid frequent calls to READ_DBL for read operations.