Extended instructions
9.10 Data block control
S7-1200 Programmable controller
534 System Manual, V4.2, 09/2016, A5E02486680-AK
Data block control
9.10.1
CREATE_DB (Create data block)
Table 9- 219 CREATE_DB instruction
REQ:=_bool_in_,
LOW_LIMIT:=_uint_in_,
UP_LIMIT:=_uint_in_,
COUNT:=_udint_in_,
ATTRIB:=_byte_in_,
BUSY=>_bool_out_,
DB_NUM=>_uint_out_);
Use the instruction "CREATE_DB" to create a
new data block in the load and/or work memory.
The instruction "CREATE_DB" does not change
the checksum of the user program.
A data block that you create only in work memory
has the following properties:
• After a memory reset or POWER OFF /
POWER ON this block no longer exists.
• When loading or when there is a STOP-RUN
transition, its content remains unchanged.
The data block created is assigned a number from the range defined at the LOW_LIMIT (low
limit) and UP_LIMIT (high limit) parameters. "CREATE_DB" assigns the smallest possible
number from the specified range to the DB. You cannot assign the numbers of the DBs
already contained in the user program.
To create a DB with a specific number, enter the same number for the high and low limit of
the range to be specified. If a DB with the same number already exists in the work memory
and/or load memory, or if the DB exists as a copied version, the instruction will be terminated
and an error message will be generated at the RET_VAL parameter.
Start values of the data block
The SRCBLK parameter is used to define start values for the DB that is to be created. The
SRCBLK parameter is a pointer to a DB or a DB area from which you apply the start values.
The DB addressed at the SRCBLK parameter must have been generated with standard
access ("Optimized block access" attribute disabled).
● If the area specified at the SRCBLK parameter is larger than the DB generated, the
values up to the length of the DB generated will be applied as start values.
● If the area specified at the SRCBLK parameter is smaller than the DB generated, the
remaining values will be filled with "0".
To ensure data consistency, you must not change this data area while "CREATE_DB" is
being executed (which means as long as the BUSY parameter has the value TRUE).