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