Siemens SIMATIC S5-115U User Manual page 187

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

S5-115U Manual
A function block call consists of:
Call statement
- JU
FBx
Absolute call of the FB x ( J ump A bsolute...)
Call if RLO=1 ( J ump C onditional...)
- JC
FBx
Parameter list (only necessary if block parameters have been defined in the FB)
Function blocks can only be called if they have already been programmed. When a function block
call is being programmed, the programmer automatically requests the parameter list for the FB,
provided block parameters have been defined in the FB.
Assigning Function Block Parameters
The program in the function block specifies how the formal operands (the parameters defined as
"DECL") are to be processed.
As soon as you program a call statement (e.g. JU FB2), the programmer displays the parameter list .
The parameter list consists of the names of the parameters each followed by a colon (:). Actual
operands must now be assigned to the parameters. When the FB is called, the actual operands
replace the formal operands defined in the FB so that the FB "actually" works with actual
operands.
The parameter list may contain up to 40 parameters.
Example:
The name (DECL) of a parameter is IN 1, the parameter type is I (input) and the data type is BI (bit).
The formal operand of the FB then has the form
DECL: IN1 I
BI.
The parameter list in the calling block specifies which (actual) operand is to replace the formal
operand in the event of the FB being called; in the example this is the operand "I 1.0".
The parameter list must therefore contain the entry
IN1:
I 1.0.
When the FB is called, it replaces the formal operand "EIN1" with the actual operand "I 1.0".
Figure 7-6 contains a detailed example of the parameter assignment of a function block.
The function block call occupies two words in the internal program memory and each parameter a
further memory word.
The required memory length of the standard function blocks as well as the execution time are
specified in Catalog ST 57.
The identifiers for the inputs and outputs of the function block appearing on the programmer
during programming are deposited, together with the name, in the function block itself. It is
therefore necessary to transfer all required function blocks to the program diskette (in the case of
off-line programming) or enter them directly into the program memory of the PLC before
programming begins on the programming unit.
EWA 4NEB 811 6130-02b
Introduction to STEP 5
7-15

Advertisement

Table of Contents
loading

Table of Contents