Overview: Create and/or Call Functions & Function Blocks

To call a functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. or function blockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs.:

  1. Drag an item from the Libraries into a programClosed The act of performing a sequence of instructions or commands.
  2. Name the new instance of the function or function block

See Call Functions or Function Blocks for more in-depth information.

To create a function or function block:

  1. Declare the function or function block by right-clicking on Subprograms in the Project Tree.
  2. Name the function or function block
  3. Define the inputs and outputs, and any private variables
  4. Call the new function or function block

See Create Functions and Function Blocks for more in-depth information.

See Also: Differences between Functions and Function Blocks