Differences between Functions and Function Blocks

It is important to clearly understand what is different between functions and function blocks.

  • A  Function is called once and it performs an action.
    • This is synchronous.
  • A  Function Block (FB) is an instance that has its own set of data.
    • An FB maintains its own, internal machine state and often has an output to indicate when the work is done.
    • An FB is asynchronous.
    • The best way to work with a function block is to call it during multiple scan.
      • This triggers the action the first time, then monitor the status of this action, especially via the Done output.

See Also