Blocks

Block elements can be operators, functions, or function blocks. Connect block inputs and outputs to variables, contacts or coils, or other block inputs and outputs. Insert block elements in language containers.
Functions and function blocks are represented by a box displaying the name of the function, function block, or operator, and the parameter short names. For function blocks, the instance name displays in italics.
For functions, the return parameter is the only output. For function blocks, multiple return parameters can provide multiple outputs. The return parameter of a function has the same name as the function. The return parameters of a function block can have any name.
Define the parameters of program organization units (POUs) for multiple controllers by navigating the tabs for individual controllers that display in the parameter view.
For loops in blocks, use local variables since these are initialized with a value. The following Functional Block Diagram (FBD) diagram shows valid loops where local variables initialize both inputs of the greater than or equal operator and one input of the first AND operator while the output of the second AND operator initializes the second input of the first AND operator.
Using loops with functions or operators may yield unpredictable results since these types of blocks use temporary variables generated by the FBD editor. For predictable results, it is recommended to assign variables in loops. The following example displays an FBD diagram with a loop that results in an unpredictable result. When a variable is added in the loop, the result becomes predictable.
TIP: Since instances of function blocks are defined in the library, the FBD editor does not generate temporary variables.
Unpredictable Result
Predictable Result
Blocks elements may be resized.
To insert a block element
  1. From the
    Toolbox
    , drag the block element into the language container.
    The block selector displays.
  2. In the
    Block Selector
    , choose the required function block, then click
    OK
    . Sort the block list according to the columns by setting these in ascending or descending order.
    The selected block displays in the language container.
    TIP: If deleting a library function block instance from a POU by mistake, do not use the Undo command. Insert the library function block again.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal