Extended instructions
9.10 Data block control
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
535
The "CREATE_DB" instruction works asynchronously. Processing takes place across
several calls. You start the job by calling "CREATE_DB" with REQ = 1.
The output parameters RET_VAL and BUSY indicate the status of the job.
See also: DELETE_DB (Delete data block) (Page 542)
The following table shows the parameters of the "CREATE_DB" instruction:
REQ Input BOOL I, Q, M, D, L or con-
stant
Level-triggered control parameter "request to activate"
REQ = 1: Request to generate the data block
LOW_LIMIT Input UINT I, Q, M, D, L or con-
stant
Low limit of the range for the assignment of a DB number. The
smallest possible number is 60000.
UP_LIMIT Input UINT I, Q, M, D, L or con-
High limit of the area used by "CREATE_DB" to assign a num-
ber to your DB (largest possible DB number: 60999)
COUNT Input UDINT I, Q, M, D, L or con-
stant
The count value specifies the number of bytes which you want
to reserve for the DB generated. The number of bytes must be
an even number. The maximum length is 65534 bytes.
ATTRIB Input BYTE I, Q, M, D, L or con-
stant
You use the first 4 bits of the byte at parameter ATTRIB to
define the properties of the data block *:
• Bit 0 = 0: Attribute "Only store in load memory" is not set.
• Bit 0 = 1: Attribute "Only store in load memory" is set. With
this setting, the DB takes up no space in the work memory
and is not included in the program. The DB cannot be ac-
cessed with bit commands. When bit 0 = 1, the selection for
bit 2 is irrelevant.
To ensure compatibility with STEP 7 V5.x, bits 0 and 3 must be
considered together (see below).
• Bit 1 = 0: Attribute "Data block write-protected in the device"
is not set.
• Bit 1 = 1: Attribute "Data block write-protected in the device"
is set.
•
Bit 2 = 0: DB is retentive (only for DBs generated in the load
and in the work memory). The DB is regarded as retentive if
at least one value has been set as retentive.
• Bit 2 = 1: DB is not retentive
Retentivity is not supported with DBs that are only stored in
load memory or only in the work memory. If you call the
"CREATE_DB" instruction with one of the two combinations
"retentive and only load memory" or "retentive and only work
memory" the DB to be generated will not be marked as reten-