Introduction to STEP 5
PB 3
: JU
FB5
NAME : EXAMPLE
X1
: I 0.0
X2
: F 1.3
X3
: Q 1.0
.
.
: A I 0.1
: JC FB5
NAME : EXAMPLE
X1
: I 0.3
X2
: I 0.2
X3
: Q 1.0
7.3.5
Data Blocks
Data blocks (DB) store data to be processed in a program.
The following data types are permissible:
•
Bit pattern (representation of controlled system states)
•
Hexadecimal, binary or decimal numbers (times, results of arithmetic operations)
•
Alphanumeric characters (ASCII message texts)
7-16
Parameter list
for first call
Actual operands
Parameter list
for second call
Formal operands
Figure 7-6. Programming a Function Block
FB 5
NAME : EXAMPLE
DES:
X1 I
BI
DES:
X2 I
BI
DES:
X3 Q BI
: A = X1
: A = X2
: = = X3
: BE
Formal operands
S5-100U
Executed
program
First call
A
I 0.0
A
F 1.3
=
Q 1.0
Second call
A
I 0.3
A
I 0.2
=
Q 1.0
EWA 4NEB 812 6120-02