2.3.3
Calling Function Blocks
and Assigning Parameters
to them
You can call every function block as often as you want anywhere in
your STEP 5 program. You can call function blocks in a statement list
or in one of the graphic methods of representation (CSF or LAD).
To call a function block and assign parameters to it, perform the
following steps:
Step
Action
Reaction on PG
1
Make sure that the called function block exists either
in the PG memory (offline) or in the CPU memory
(online).
none
2
Enter the call statement for the function block in the
block where the call is to originate.
You can program a function block call in an
organization, program or sequence block or
in another function block.
After you enter the call statement
(e.g. JU FB200), the name of the
relevant function block and the formal
operand list appear automatically.
3
Assign the actual operand relevant to this call to each
of the formal operands, i.e. you assign parameters to
the function block.
These actual operands can be different for
separate calls (e.g. inputs and outputs for the
first call of FB 200, flags for the second call).
Using the formal operand list, you assign the
required actual operands for each function
block call.
none
Unconditional/conditional call
Unconditional call
Conditional call
"JU FBn" for FB function blocks or
"DOU FXn" for FX extended function blocks:
the referenced function block is processed
regardless of the previous result of logic
operation (RLO).
"JC FBn" for FB function blocks or
"DOC FXn" for FX extended function blocks:
the referenced function block is only
processed when the result of logic operation
RLO = 1. If RLO = 0 the block call is not
executed. Regardless of whether the block call
is executed or not, the RLO is alsways set to "1".
After the unconditional or conditional call, the RLO can no longer be combined logically. However, it is
carried over to the called function block with the jump and can be evaluated there.
Function Blocks
CPU 948 Programming Guide
2 - 28
C79000-G8576-C848-04
Содержание CPU 948
Страница 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Страница 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Страница 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Страница 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Страница 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Страница 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Страница 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Страница 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Страница 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Страница 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Страница 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Страница 404: ...Operations with the Base Address Register BR Register CPU 948 Programming Guide 9 34 C79000 G8576 C848 04 ...
Страница 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Страница 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Страница 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Страница 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Страница 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...