Siemens SIMATIC S5-100U System Manual page 193

Simatic s5 series cpu 100/102/103
Hide thumbs Also See for SIMATIC S5-100U:
Table of Contents

Advertisement

S5-100U
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 DW1
C DB20
T DW3
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.
EWA 4NEB 812 6120-02b
STL
DB10
C
DB 10
DW1
L
DW 1
.
.
.
.
DB20
C
DB 20
DW3
T
DW 3
STEP 5 Operations
Explanation
The information from data word DW1
in data block DB10 is loaded into the
accumulator. The contents of ACCU 1
are stored in data word DW3 of data
block DB20.
8-35

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents