Skip to main content

Programming in the Function Block Diagram (FBD)

Creating a POU in the Instruction List (IL) implementation language

  1. Select an application in the device tree.

  2. Click Project → Add Object → POU.

    The Add POU dialog opens.

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

    Click 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 ToolBox view is also opened automatically, where the suitable elements, operators, and function blocks are available for FBD programming.

Programming a network

  1. In the implementation part, click inside the automatically inserted empty network.

    The network has a yellow background and the area at the left side with the network number has a red background.

  2. Right-click to open the context menu.

    You get a list of commands, including the insert commands for the elements which can be inserted at this position.

  3. Use the menu commands or drag the elements from the ToolBox to insert the elements required for your programming.

  4. For example, click 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. The Input Assistant is available.

  6. Move the cursor over the assignment line.

    The possible insertion positions for more elements are displayed as gray diamonds. Click a diamond to select that position and the suitable insert commands are once again available.

  7. Alternatively, you could also drag an element from the ToolBox into the network. For example, in the ToolBox click the box element, press down the mouse button and drag the cursor over the network.

    Each possible insertion position is displayed in 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. The Input Assistant is available.

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

Programming branches (subnetworks)

  1. In the implementation part of your POU, use the FBD/LD/IL → Insert Network command or drag it from the ToolBox to insert a new network.

  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 Branch element from the ToolBox into your implementation and drop it at the green insertion position directly at the output of the operator.

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

  4. More FBD elements and also more branches can now be added to each of the two subnetworks.