Programming Function Block Diagrams (FBD)

Creating a POU in the function block diagram (FBD) implementation language

  1. Select an application in the device tree.

  2. Select the command Project ‣ Add object ‣ POU .

    ⇒ The dialog box Add POU opens.

  3. Enter a name and select the implementation language Function Block Diagram (FBD).

    Click on Add.

    ⇒ The POU is added to the device tree and opened in the editor. It consists of the declaration editor in the top part and the implementation part with an empty network in the lower part. The view ToolsBox is also automatically opened , in which the suitable elements, operators and function blocks for FBD programming are available.

See also

Programming a network

  1. Click inside the automatically inserted empty network in the implementation part.

    ⇒ The network is given a yellow background and the area at the left-hand side with the network number is given a red background.

  2. Open the context menu with the right mouse button.

    ⇒ You obtain amongst other things the insert commands for the elements that can be inserted at this point.

  3. Insert the elements required for your programming using the menu commands or by dragging in the elements from the toolbox.

  4. For example, select the command Insert Assignment.

    ⇒ An assignment line is inserted. In each case three question marks stand for assignment source and assignment target.

  5. Select the question marks and replace them with the desired variable. Input assistance is available for this purpose.

  6. Move the cursor over the assignment line.

    ⇒ The possible insertion positions for further elements are displayed as grey diamonds. A click on a diamond selects that position and the suitable insert commands are once again available.

  7. Alternatively, you can drag an element with the mouse from the toolbox into the network. For example, click in the tool box on the box element, keep the mouse button pressed and move the cursor over the network.

    ⇒ Each possible insertion position lights up green.

  8. Release the mouse button in order to insert the box.

    ⇒ The box is displayed in the network. The type of box on the inside and the instance name above the box, which is required in the case of a function block, are still kept free with three question marks.

  9. Select the string ??? inside the box and replace it with the name of the box. Input assistance is available for this purpose.

    ⇒ The inputs and outputs of the selected box are displayed. They are still kept free with question marks, as is the instance name in the case of a function block.

See also

Programming line branches (subnetworks)

  1. In the implementation part of your POU, insert a new network using the command FBD/LD/IL ‣ Insert network or drag it in from the tool box.

  2. For example, drag an ADD operator into the empty network and replace the characters ??? with two variables of the type INT.

  3. Drag the element Branch from the tool box into your implementation and release the mouse button at the green insertion position directly at the output of the operator.

    ⇒ The line branch splits the processing line at the output of the operator box into 2 subnetworks.

  4. Further FBD elements and also further line branches can now be added to each of the two subnetworks.

See also

See also