Data Blocks (Dbs) - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

Introduction to STEP 5
PB 3
: JU
FB5
NAME : EXAMPLE
X1
:
I 4.1
X2
:
F 1.3
X3
:
Q 0.1
.
.
: A
I 5.2
: JC
FB5
NAME : EXAMPLE
X1
:
I 4.5
X2
:
I 5.3
X3
:
Q 0.1
2.3.5

Data Blocks (DBs)

Data blocks store data to be processed in a program.
The following data types are permissible:
Bit pattern (representation of process states)
Hexadecimal, binary, or decimal numbers (times, results of arithmetic operations)
Alphanumeric characters (message texts)
Programming:
Begin data block programming by specifying a block number between 4 and 255. (DB 0 is reserved
for the block address list. DB 1 is reserved for configuration, and DB 2 and DB 3 are reserved for
error DBs.) Data is stored in words. If the information takes up less than 16 bits, the remaining bits
are assigned zeros. Data input begins at data word 0 and continues in ascending order. A data
block can hold up to 4096 data words. You can access a data block up to DW 255 with the
"L DW""and "T DW" operations. Figure 2-8 shows an example of data block contents.
2-18
Parameter list for
first call
Actual operands
Parameter list for
second call
Formal operands
Figure 2-7. Programming a Function Block
FB 5
NAME :
EXAMPLE
DECL.:
X1 I
BI
DECL :
X2 I
BI
DECL :
X3 Q BI
: A = X1
: A = X2
: = = X3
: BE
Formal operands
S5-115F Manual
Executed program
A
I 4.1
A
F 1.3
=
Q 0.1
A
I 4.5
A
I 5.3
=
Q 0.1
EWA 4NEB 811 6149-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents