All FC parameters are passed by pointer rather than by value so it doesn't matter if it's a bool or a UDT, the processing is the same. For FB's simple variables (BOOL, INT etc. FBs and FCs receive parameters through the IN and IN/OUT interface types. When the user program passes a parameter to a. FB_init is always implicitly available and is generally called in order to perform the standard initialization (implicit call). If the explicitly defined. Both FCs and FBs are useful where a certain sequence of logic needs to be repeated and/or re-used in multiple places, but with different inputs and outputs. An example would be level control of several otherwise identical tanks, where the control algorithm involves more than a Start/Stop Circuit. Function Blocks can also use temporary variables, which exist only during a single program cycle and are not saved in the instance DB. Function Blocks are different from Functions (FC), as Functions do. A Function Block is a reusable block that can store data between scans. When calling a function block into your code you will be asked to assign a data block also called data instance to be associated with.
[PDF Version]