Technical data

9.3.1
Example of Transferring
Memory Fields
a) Task
You want to copy a field of maximum 4095 data words from a DB or DX data
block to a different DB or DX data block. The start of the field of data
is specified within the source and destination data block by an offset
value between 0 and 4095.
The program is stored in FB 10.
Before the copying function is started, the input parameters are
checked. In the event of an error, bit no. 7 = 1 is set in the output
parameter STAT and the type of error specified in bits no. 0 to no. 2 as
follows:
Continued on next page
KY (type, no.)
Source DB
KF (Offset )
Source DB
KY (type, no.)
Dest. DB
KF (Offset)
Dest. DB
KF (block length)
STNO
SOFF
DTNO
DOFF
LENG
FB10
STAT
BY
Status
Fig. 9-9 Function block for transferring fields of data
12345670
0 = no error
1 = error
Bit no.
Type of error
1 = source DB = destination DB
2 = offset or length > 4095
3 = source DB does not exist or illegal
4 = source DB too short
5 = destination DB does not exist or illegal
6 = destination DB in read-only memory (EPROM submodule)
7 = destination DB too short
9
Transferring Fields of Memory
CPU 928B Programming Guide
C79000-B8576-C898-01
9 - 21