Function Blocks
Function blocks are program organization units (POUs) with multiple input and output
parameters. These are instantiated meaning local variables of a function block are
copied for each instance. When calling a function block in a program, call the instance
of the block where the same code is called but the data used is that which has been
allocated to the instance. The values of the variables of an instance are stored from
one cycle to the other.
Any POU in a project can call function blocks. Function blocks can call functions or
other function blocks. The order of appearance of function blocks within their section
is not important.
Define the interface of a function block with a type and a unique name for each of its
calling (input) parameters or return (output) parameters. Function blocks can have more
than one output parameter. The value of a return parameter for a function block differs
for the various programming languages.
Move or copy all function blocks to the Programs section and all but the SFC function
block to the Functions section. Also move or copy functions and programs, written with
languages supported by function blocks, to the Functions section. When moving or copying
a program to the Function Blocks section, all local variables defined in the program are
converted to function block parameters.
Function blocks within a project and the global library must have unique names within a
scope. Function block names and function block parameter names are limited to 128
characters beginning with a letter followed by letters, digits, and single underscores.
The last character for a function block name must be a letter or digit; function block
names cannot end with an underscore character. Reserved words, defined words, or data
types, such as elementary, structures, or arrays are not valid names.
Each instance of IEC 61131-3 or 'C' written function corresponds to data stored in
AADvance virtual machine real time database. Do not add new automatic instances of IEC
61131-3 function blocks or of standard 'C' function blocks with or without initial
values. Work with function blocks declared in the
Dictionary
to enable online
changes.User 'C' Function Blocks cannot be added.
Provide Feedback