Hide thumbs Also See for S7-1200:
Table of Contents
Extended instructions
8.8 Data block control
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
Avoid excessive WRIT_DBL flash memory write operations
The WRIT_DBL instruction performs write operations in flash memory (internal load memory
or memory card). WRIT_DBL should be used for infrequent updates like a production
process changes.
The data blocks used by READ_DBL and WRIT_DBL must have been previously created by
STEP 7 before you can use these instructions. If the source DB is created as a "standard"
type then the destination DB must also be the "standard" type. If the source data block is
created as an "optimized" type then the destination data block must also be the "optimized"
type.
If the DBs are standard, then you can specify either a tag name or a P# value. The P# value
allows you to specify and copy any number of elements of the specified size (Byte, Word, or
DWord). Thus, you can copy part or all of a DB. If the DBs are optimized, you can only
specify a tag name; you cannot use the P# operator. If you specify a tag name for either
standard or optimized DBs (or for other work-memory types), then whatever is referenced by
this tag name is copied. This could be a user-defined type, an array, or a basic element.
Type Struct can only be used by these instructions if the DB is standard, not optimized. You
must use a user-defined type (UDT) if it is a structure in optimized memory. Only a user-
defined type ensures that the "data types" are exactly the same for both the source and
destination structures.
Note
Using a structure (data type Struct) in an "optimized" DB
When using a Struct data type with "optimized" DBs, you must first create a user-defined
data type (UDT) for the Struct. You then configure both the source and destination DBs with
the UDT. The UDT ensures that the data types within the Struct remain consistent for both
DBs.
For "standard" DBs, you use the Struct without creating a UDT.
READ_DBL and WRIT_DBL execute asynchronously to the cyclic program scan. The
processing extends over multiple READ_DBL and WRIT_DBL calls. You start the DB
transfer job by calling with REQ = 1 and then monitor the BUSY and RET_VAL outputs to
determine when the data transfer is complete and correct.
To ensure data consistency, do not modify the destination area during the processing of
READ_DBL or the source area during the processing of WRIT_DBL (that is, as long as the
BUSY parameter is TRUE).
402
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents