Technical data

Table Of Contents
Copy and Block Functions
System Software for S7-300/400 System and Standard Functions - Volume 1/2
3-8
A5E00709327-01
3.4 Creating a Data Block with SFC 22 "CREAT_DB"
Description
With SFC 22 "CREAT_DB" (create data block), you create a data block that does
not contain initialized values. Instead, it contains random data. The SFC creates a
data block of a selectable length with a block number taken from a specified range.
The SFC assigns the lowest possible number to the DB from the specified range. If
you want to create a DB with a particular number, simply select the range
specifying the same value as the upper and lower limit. You cannot assign a
number if a DB with the same number already exists in the user program. The
length of the DB must be an even number of bytes.
Interruptability
SFC 22 "CREAT_DB" can be interrupted by higher priority OBs. If SFC 22
"CREAT_DB" is called again in a higher priority OB, the call is rejected with error
code W#16#8091.
Parameter Declarati
on
Data Type Memory Area Description
LOW_LIMIT INPUT WORD I, Q, M, D, L,
constant
The lower limit value is the smallest
number in the range of numbers that
you can assign to your data block.
UP_LIMIT INPUT WORD I, Q, M, D, L,
constant
The upper limit value is the highest
number in the range of numbers you
can assign to your data block.
COUNT INPUT WORD I, Q, M, D, L,
constant
The count value specifies the number
of data bytes you want to reserve for
your data block. Here you must specify
an even number of bytes (maximum
65534).
RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs while the function is
being executed, the return value
contains an error code.
DB_NUMBER OUTPUT WORD I, Q, M, D, L The data block number is the number
of the created data block. If an error
occurs, (bit 15 of RET_VAL was set)
the value 0 is entered in DB_NUMBER.