Siemens SIMATIC S5-115U User Manual page 189

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

S5-115U Manual
Programming Data Blocks
Begin data block programming by specifying a block number between 2 and 255. DB0 is reserved
(for the operating system) and DB1 is reserved (for initializing internal functions (see Chapter 11)
and for defining interprocessor communication flags (see Chapter 12)). The data is deposited in
this block in words. If the information is less than 16 bits in volume, the higher-order bits are filled
with zeros. Entry of the data begins at data word zero and is continued in ascending order. The
data block can accommodate up to 2042 data words. Accessing is possible up to DW 255 using the
"L DW" and "T DW" operations. Data words 256 to 2042 can only be accessed using the "LIR",
"TIR" and "TNB" operations.
Input
0000
:
KH =
0001
:
KT =
0003
:
KF =
Figure 7-7. Example of the Contents of a Data Block
Data blocks can also be generated or deleted in the control program (see Section 8.1.8).
Program Processing with Data Blocks:
A data block must be called in the program with the C DB x operation (x=no.).
Within a block, a data block remains valid until another data block is called.
When the program jumps back into the higher-level block, the data block that was valid
before the block call is again valid.
In all organization blocks (OBs), the data blocks used by the user program must be opened
with the relevant C DBxx operation.
Valid
DB
PB7
C DB10
DB10
JU PB20
DB10
When PB20 is called, the valid data area is entered into a memory.
When the program jumps back, this area is reopened.
EWA 4NEB 811 6130-02b
A13C
100.2
+21874
Figure 7-8. Validity Areas of Data Blocks
Introduction to STEP 5
Values stored
DW0
DW1
DW2
Valid
PB20
DB
DB10
C DB11
DB11
A13C
2100
5572
7-17

Advertisement

Table of Contents
loading

Table of Contents