Siemens SIMATIC S5 Manual page 131

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

Manual S5-115F
Calling a data block "C DB"
Data blocks are always called unconditionally. All data processed following the call refers to the
data block that has been called.
This operation cannot generate new data blocks. Blocks that are called must be programmed
before program scanning.
Example: Program block PB 3 needs information that has been programmed as data word DW 1
in data block DB 10. Other data, e.g. the result of an arithmetic operation, is stored as
data word DW 3 in data block DB 20.
Program Sequence
PB 3
C DB 10
L DW 1
C DB 20
T DW 3
Generating and deleting a data block
The "G DB x" statement does not call a data block. Instead, it generates a new block. If you want
to use the data in this data block, call it with the "C DB" statement.
Before the "G DB" statement, indicate in ACCUM 1 the number of data words the block is to have.
If you specify zero as the data block length, the data block in question is deleted, i.e. it is removed
from the address list. It is considered nonexistent.
If you try to set up a data block that already exists, the "G DB x" statement is not executed.
The length of data blocks set up in this way is optional. However, please note that programmers
can process blocks of limited length only.
EWA 4NEB 811 6149-02
STL
DB 10
C DB 10
DW 1
L DW 1
DB 20
C DB 20
T DW 3
DW 3
The information from data word
DW 1 in data block DB 10 is loaded
into the accumulator. The contents of
.
ACCUM 1 are stored in data word
.
DW 3 of data block DB 20.
.
.
STEP 5 Operations
Explanation
3-35

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents