1.5 PLCs - Programming - FBDs and Boolean Expressions
1.5 PLCs - Programming - FBDs and Boolean Expressions
Introduction Introduction…
FBD: Function Block Diagram The FBD is depicted as a rectangular block with inputs entering
from the left and outputs emerging from the right
FBD is a PLC program described in terms of graphical blocks
or more output values The function block type name is shown in the block, such as AND,
with the name of the function block in the system shown above it,
A block is represented with the function name written in the box
for example Timer1
Names of function block inputs are shown within the block at the
appropriate input and output points.
2/4/2021 PLC Programming 3 2/4/2021 PLC Programming 4
1
Introduction… Introduction…
Cross-diagram connectors are used to indicate where graphical
lines would be difficult to draw without cluttering up or
complicating a diagram and show where an output at one point is
used as an input at another
2
Logic Gate Symbols Logic Gate Symbols…
1 in a box: indicates that there is an output when the input is 1
3
Effect of Functional Blocks in PLC Effect of Functional Blocks in PLC
Programs… Programs…
OR Function: OR Function:
4
Effect of Functional Blocks in PLC Effect of Functional Blocks in PLC
Programs… Programs…
XOR Function: XOR Function:
Examples: Ladder Diagrams and Equivalent Examples: Ladder Diagrams and Equivalent
FBDs FBDs…
Example 1: Example 2
5
Examples: Ladder Diagrams and Equivalent Example Application
FBDs…
Example 3: Consider the development of a function block diagram and ladder
diagram for an application in which a pump is required to be
activated and pump liquid into a tank when the start switch is
closed, the level of liquid in the tank is below the required level,
and there is liquid in the reservoir from which it is to be pumped
Example Application…
What is required is an AND logic situation between the start switch
input and a sensor input that is on when the liquid in the tank is
below the required level
We might have a switch that is on until the liquid is at the required Boolean Algebra
level
6
Introduction Example 1
Ladder programs can be derived from Boolean expressions The Boolean expression
AND Operation:
Example 1… Example 2
The ladder diagram and FBD for the above: The Boolean expression:
7
Example 2… Example 3
The ladder diagram and FBD for the above: An XOR gate assembled from NOT, AND, and OR gates:
Example 4 Example 4…
Consider the below logic diagram with many inputs The ladder diagram for the above is:
8
Application Examples Application Examples…
Example 1: A signal lamp is required to be switched on if a pump Example 2: consider a valve that is to be operated to lift a load
is running and the pressure is satisfactory, or if the lamp test switch when a pump is running and either the lift switch or a switch
is closed indicating that the load has not already been lifted and is at the
bottom of its lift channel is operated
9
Location of Stop Switches… Location of Stop Switches…
10
Location of Emergency Stop Switch… Exercise 1
If the emergency stop switch is in the input to the PLC then if the Draw the ladder diagram equivalent of the following function
PLC malfunctions it might not be possible to stop the motor block diagram
The motor will thus not restart when the emergency stop button is
released
Exercise 2 Exercise 2…
A machine is being designed to wrap boxes of chocolate. The d) The box arrives and is detected by an optical sensor (P). After
boxes arrive at the machine on a conveyor belt. The list below this the conveyor (C) is stopped and the box is clamped in
shows the process steps in sequence. place (H).
a) The box is manually inserted on a conveyor by the e) A wrapping mechanism (W) is turned on for 2 seconds
operator f) A sticker cylinder (S) is turned on for 1 second to put
b) The push button START is pressed by the operator and the consumer labeling on the box
conveyor (C) starts moving g) The clamp (H) is turned off and the conveyor C is turned on
c) Process stops operating when the STOP button is
momentarily pressed
2/4/2021 PLC Programming 43 2/4/2021 PLC Programming 44
11
Exercise 3 Exercise 4
Draw the function block diagrams to represent: Write the Boolean equations to represent the following:
a) There is to be a motor startup when either switch A or switch B a) There is an output Q when either input A or input B occurs
is activated b) There is an output Q when either input A or input B occur but
b) A motor is to be started when two normally open switches are not when input C occurs
activated and remain on even if the first of the two switches c) There is an output Q when input A occurs but not when input
goes off but not if the second switch goes off B occurs
c) A pump is to be switched on if the pump start switch is on or a
test switch is operated
Exercise 5 Exercise 6
For safety reasons, machines are often set up to ensure that a Draw the ladder rungs represented by the Boolean equations:
machine can only be operated by the operator pressing two
switches simultaneously, one by the right hand and one by the left
hand. This is to ensure that both the operator’s hands will be on the
switches and cannot be in the machine when it is operating. Draw a
ladder rung for such a requirement
12
Exercise 7
Write the Boolean expression, draw the FBD and typical PLC
ladder logic diagram for a control system wherein a fan is to run
only when all of the following conditions are met:
Input A is OFF
END
Input B is ON or input C is ON, or both B and C are ON
13