Introduction to STEP 5S5-115F Manual2.3.4 Function Blocks (FBs)Frequently recurring or complex control functions are programmed in function blocks.Function blocks have the following special features:• FBs can be assigned parameters.Actual parameters can be assigned when the block is called.• FBs have a supplementary set of operations not available to other blocks.• The FB program can be written and documented in STL only.The S5-115F has the following types of function blocks:• FBs that you can program• FBs that are integrated in the operating system• FBs that are available as software packages (Standard Function Blocks, Catalog ST 57)The program counter (LPLZ) sequence is the first operation for all FBs ( 3.8):• LFW0• LKF+ 1• + F• TFW0Memory requirementIn addition to the block header, function blocks have more organization information than otherblocks.Memory requirements are as follows:• Block header (5 words)• Block name (5 words) including jump operation (1W)• Block parameters for initialization (3 words per parameter; 40 parameters max.)• Block code (max. 127 W)• BE operation (1 W)Creating a function blockIn contrast to other blocks, the following additional information can be stored in a function block:• Library numberThe block can be assigned a number from 0 to 65535. This number is not dependent onsymbolic or absolute parameters of the FB.A library number should be prescribed only once to identify a particular function block clearly.Standard function blocks have their own product number.• NameA function block can be ”labelled” with a name of up to eight characters.To assign parameters, you must program the following block parameter information:• Block parameter name (formal operand)Each block parameter as formal operand is given a designation (DECL). Under this designationit is replaced by an actual operand when the function block is called.The name can be up to four characters long and must begin with a letter of the alphabet. Youcan program up to 40 parameters per function block.2-14EWA 4NEB 811 6149-02