Technical data

Table Of Contents
Copy and Block Functions
System Software for S7-300/400 System and Standard Functions - Volume 1/2
3-6
A5E00709327-01
3.3 Initializing a Memory Area with SFC 21 "FILL"
Description
With SFC 21 "FILL," you can initialize a memory area (destination area) with the
contents of another memory area (source area). The SFC copies the contents of
the specified destination area until the memory area is completely full.
Note
The source and destination field must not overlap.
If the destination area to be initialized is not a whole multiple of the length of the
input parameter BVAL, the destination area is nevertheless written up to the last
byte.
If the destination area to be initialized is smaller than the source area, the function
only copies as much data as can be written to the destination area.
If the destination or source area actually present is smaller than the size of the
parameter set for the memory area of the source or destination area (BVAL, BLK
parameters), no data will be transferred.
If the ANY pointer (source or destination) is of the type BOOL, the length specified
must be divisible by 8; otherwise the SFC will not be executed.
A B
C D
E F
G H
A B
C D
E F
G H
A B
C D
E F
G H
A B
C D
MW14
MW16
MW18
MW20
MW100
MW102
MW104
MW106
MW108
MW110
MW112
MW114
MW116
MW118
BVAL
BL
K
FILL
Example: The content of the area MW100 to MW118 will be
written with the contents of memory words MW14 to MW20.