Siemens SIMATIC S5-95F Manual page 214

Table of Contents

Advertisement

STEP 5 Operations
Call 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 or
created before program scanning.
Example: Program block PB3 needs information that has been programmed as data word DW1 in
data block DB10. Other data, e.g., the result of an arithmetic operation, is stored as
data word DW3 in data block DB20.
Program Sequence
PB3
C DB10
L DW 1
C DB20
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 ACCU 1 the number of data words the block is to have
(see the example below).
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.
Note
The block is stored in memory and is designated as invalid until the programmable
controller memory is compressed (see section 7.5.3).
If you try to set up a data block that already exists, the "G DB x" statement is not executed.
A data block can be a maximum of 256 data words (DW0 to 255) in length.
8-34
STL
DB10
C
DW 1
L
DB20
C
DW 3
T
The information from data word DW1
DB 10
in data block DB10 is loaded into the
accumulator. The contents of ACCU 1
DW 1
are stored in data word DW3 of data
.
block DB20.
.
.
.
DB 20
DW 3
S5-95F
Explanation
EWA 4NEB 812 6210-02

Advertisement

Table of Contents
loading

Table of Contents