Examples
Example 1:
the following (complete) example is intended to further clarify
the programming and calling of a function block and the assign-
ment of parameters to it. You yourself can easily try
out the example.
Programming the function block FB 202:
FB 202
SEGMENT 1
NAME
EXAMPLE
DECL :
INP1
I/Q/D/B/T/C:
I
BI/BY/W/D:
BI
DECL :
INP2
I/Q/D/B/T/C:
I
BI/BY/W/D:
BI
DECL :
OUT1
I/Q/D/B/T/C:
Q
BI/BY/W/D:
BI
:A= INP1
:A= INP2
:== OUT1
:
: BE
Function block FB 202 is called and has parameters assigned
to it in program block PB 25:
STL method of representation CSF/LAD method of representation
PB 25
SEGMENT 1
:
JU FB 202
FB 202
NAME :
EXAMPLE
EXAMPLE
INP1 :
I 13.5
I 13.5 INP1 OUT1 Q 23.0
INP2 :
F 17.7
F 17.7 INP2 :BE
OUT1 :
Q 23.0
:
BE
The following operations are executed after the jump to FB 202
Formal
operand
list
STEP 5
state-
ments
Formal
operands
Parameter
type
Data
type
Formal
operands
Actual
operands
Function Blocks
CPU 948 Programming Guide
C79000-G8576-C848-04
2 - 31
Summary of Contents for CPU 948
Page 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Page 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Page 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Page 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Page 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Page 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Page 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Page 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Page 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Page 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Page 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Page 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Page 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Page 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Page 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Page 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...