Extended instructions
9.10 Data block control
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
541
ATTR_DB (Read data block attribute)
Table 9- 223 ATTR_DB instruction
REQ:=_bool_in_,
DB_NUMBER:=_uint_in_,
DB_LENGTH=>_udint_out_,
ATTRIB=>_byte_out_);
You use the instruction "ATTR_DB" to obtain
information about a data block (DB) located in the
work memory of the CPU. The instruction deter-
mines the attributes set at the ATTRIB parameter
for the DB selected.
The length cannot be read out for data blocks
with optimized access and data blocks that are
only in load memory. In these cases, the
DB_LENGH parameter has the value "0".
Do not apply ATTR_DB to data blocks with opti-
mized access and activated memory reserve.
Do not read out the data blocks for motion control
with the "ATTR_DB" instruction. The error code
The following table shows the parameters of the "ATTR_DB" instruction:
I, Q, M, D, L or constant
REQ = 1: Request to read block attributes
DB_NUMBE
Input DB_ANY I, Q, M, D, L or constant Number of the DB to be tested
DB_LENGTH Output UDINT I, Q, M, D, L
• Number of data bytes that the selected DB con-
tains.
• "0" for data blocks with optimized access and
data blocks that are only in load memory.
ATTRIB Output BYTE I, Q, M, D, L
• Bit 0*= 0: Attribute "Only store in load memory" is
not set.
• Bit 0*= 1: Attribute "Only store in load memory" is
set.
• 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.