User-Defined Function Blocks (POU)
The list of programs is completed with User-Defined Function Blocks (UDFBs).
- UDFBs are described using FBD, FFLD, IL Language SFC, ST Language.
- They can be used as other function blocks in the programs of the application.
- Input and output parameters plus private variables of a UDFB are declared in the variable editor as local variables of the UDFB.
- There is no restriction using any operation in a UDFB.
- A UDFB can call standard functions and function blocks.
- A UDFB can call another UDFB.
- The called UDFB must be declared before the calling one in the program list.
Each time a UDFB is instantiated, its private variables are duplicated for the declared instance.
- The code of the UDFB is duplicated on each call in parent programs.
- This leads to higher performances at run-time, but consumes code space.
- It is recommended to package small algorithms in UDFBs.
- Large parts of code must be managed in programs.