Function Blocks

Function blocks are program organization units (POUs) that have multiple input and output parameters. Instantiating copies the local variables of a function block for each instance. A call to a function block in a program calls the instance of the block from the same location as the called code. The function block instance uses the data allocated to the instance. The
Trusted®
controller stores the variable values of an instance from one cycle to the other.
Call function blocks from any POU in a project. Call functions from function blocks.
IMPORTANT:
Function blocks written with an IEC 61131-3 language other than Ladder Diagram (LD) are unable to call other function blocks. The instantiation mechanism only manages the local variables of the block itself. When the
In-line
property is set to
True
for LD blocks, call LD function blocks from other LD function blocks, known as nested blocks.
Standard function blocks not supported for use inside an IEC 61131-3 library function block include: AVERAGE, BLINK, CMP, CTD, CTU, CTUD, DERIVATE, F_TRIG, HYSTER, INTEGRAL, LIM_ALRM, R_TRIG, RS, SEMA, SIG_GEN, SR, STACKINT, TOF, TON, and TP.
Define the interface of a function block with a type and a unique name for each of its input parameters or output parameters. Function blocks can have more than one output parameter. The value of an output parameter for a function block differs per programming language.
Function blocks within a project and the global library have these naming conventions and limitations:
  • Unique names limited to eight (8) characters beginning with a letter or single underscore followed by letters, digits, and single underscores.
  • A maximum of 32 parameters with names limited to 32 characters beginning with a letter or single underscore followed by letters, digits, and single underscores.
  • Names cannot be reserved words, defined words, or data types.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal