Function Block Diagram (FBD)
IEC 61131-3 is an international standard first published in December 1993 by the IEC. This standard defines Two Graphical and Two Textual Controller Programming language standards.
Figure 1-0. IEC Programming Languages Summary
The Function Block Diagram (FBD) is a Graphical Language for programmable logic controller design, It can describe the function between input variables and output variables. A function is described as a set of elementary blocks. Input and output variables are connected to blocks by connection lines.
Inputs and outputs of the blocks are wired together with connection lines or links. Single lines may be used to connect two logical points of the diagram:
- An input variable and an input of a block
- An output of a block and input of another block
- An output of a block and an output variable
The connection is Oriented, meaning that the line carries associated data from the left end to the right end. The left and right ends of the connection line must be of the same type.
Multiple right connections, also called as divergence can be used to broadcast information from its left end to each of its right ends. All ends of the connection must be of the same type.
About Function Block Diagram
Logic Function Block Diagram (FBD) logic is one of four programming languages specified by the IEC 61131-3 standard. FBD is a process control language; most FBD instructions are not conditionally executed.
An FBD instruction is shown as a rectangle, with inputs entering from the left and outputs exiting on the right, as shown by the ADD instruction below.
Figure 1-1.Example of FBD Instruction
In the example above, IN1 and IN2 are the input operands; Q is the output operand. The constants ‘2’ and ‘3’ are the input values for IN1 and IN2 respectively; my Output is the output variable for Q with a current value of ‘5’.
The numeral 1 under the instruction name ADD inside of the FBD instruction rectangle denotes the execution order of the FBD logic on the page.
In its simplest form an FBD does the following:
- It accepts input from a variable, constant, or wire, which may be the output from another FBD instruction.
- It performs an operation by using FBD instruction.
- It stores the result of the operation in an output variable or wire. You can use the result as input to another instruction or program.
Input connection point must be only one of
Output connection point must be only one of
From an FBD block, you can call LD, ST, C, and other FBD blocks. These called as blocks may be Program Blocks (PBs), Parameterized Subroutine Blocks (PSBs), or User Defined Function Blocks (UDFBs).
Solve Order of FBD Instructions :
The solve order of Instructions in an FBD is determined by the following:
- The display position of the Instruction on the FBD page (starting at upper left)
- Which Instructions must be processed first so that the inputs to other FBD instruction can be resolved
The solve (or execution) order of each FBD instruction is indicated with a number under the
Instruction name in the instruction rectangle. The solve order is determined as follows:
- The FBD editor scans for Instructions beginning at the top left corner of the diagram, proceeding left to right and then top to bottom until it finds the top leftmost pixel of an instruction. The first instruction that is encountered in this manner is executed first, as long as all of its inputs have been resolved.
- If an instruction’s inputs are not resolved, then logic will be checked until an
Instruction’s inputs are all resolved. As inputs are resolved, the logic will be executed.
When Instructions are added to the FBD editor, they may appear as follows:
Figure 1.2 FBD Solve Order Example
In this case, as the Instructions are Encountered left-to-right, top-to-bottom, they are found the following order: ADD, MUL, and DIV. Since all inputs are resolved for each instruction, the execution order is defined.