Technical data

Table Of Contents
Copy and Block Functions
System Software for S7-300/400 System and Standard Functions - Volume 1/2
3-10
A5E00709327-01
3.5 Deleting a Data Block with SFC 23 "DEL_DB"
Description
With SFC 23 "DEL_DB" (delete data block) you delete a data block located in the
work memory and, if present, in the load memory of the CPU. The DB to be deleted
must not be open in the current or in any lower priority class, in other words, it must
not be entered in either of the two DB registers or in the B stack. Otherwise the
CPU starts OB°121 when SFC 23 is called. If OB°121 is not present the CPU
switches to the STOP mode. For S7-300 (exception: CPU 318), the DB is deleted
without calling OB121.
Note
It is not advisable to delete instance DBs with SFC 23 "DEL_DB". This always
leads to program errors. Avoid deleting instance DBs with SFC 23!
The following table explains when a DB can be deleted with SFC 23 "DEL-DB."
If ... Then ...
The DB was created by calling SFC 22 "CREAT_DB," SFC 23 can delete it.
The DB was transferred to the CPU by STEP 7 and was not created with the
keyword UNLINKED,
SFC 23 can delete it.
The DB is located on a flash card, SFC 23 cannot delete it.
Interruptability
SFC 23 "DEL_DB" can be interrupted by priority classes of a higher priority. If the
SFC is again called there, then this second call is aborted and W#16#8091 is
entered in RET_VAL.
Parameter Declaration Data Type Memory Area Description
DB_NUMBER INPUT WORD I, Q, M, D, L, constant Number of the DB to be
deleted
RET_VAL OUTPUT INT I, Q, M, D, L Error information