You are on page 1of 28

ROBT308

IndustrialAutomation
Lecture24 FunctionBlockDiagram(FBD)
programminginTIAportal

19April2016,Tuesday

IndustrialAutomation(ROBT308) Spring2016

Topics
TodaysTopics
ChangingtheprogramminglanguageoftheMain[OB1]from
LLDtoFBD
ProgrammingtheconveyordriveinFBD
ProgrammingtheheatingchambercontrolinFBD
ProgrammingthetimingofheatingchambercontrolinFBD
ProgrammingthestatuslightinFBD
Someoftheavailablefunctionblocks
ProgrammingtheHMIpanelfortheextendedexample

IndustrialAutomation(ROBT308) Spring2016

Changingtheprogramminglanguage
fromLADtoFBD
Create a new project. By default, you
will see the Main [OB1] organization
block (1). The default programming
language is Ladder Logic (2). In order
to switch the language to the FBD,
right click on the Main [OB1] and go to
the properties (3).

2
3

IndustrialAutomation(ROBT308) Spring2016

Changingtheprogramminglanguage
fromLADtoFBD
InthepropertieswindowoftheMain[OB1],selectFBDforthe
Language(1)andclickonOK(2).

IndustrialAutomation(ROBT308) Spring2016

Changingtheprogramminglanguage
fromLADtoFBD
Theprogrammingenvironmentwillchangeabittomakeitsuitable
fortheFBDprogramming(1).Theitemsinthefavoritetoolbarare
changedtoFBDitemsaswell(2).
2

IndustrialAutomation(ROBT308) Spring2016

AssigningvariablesinFBD
Now, we want to create the FBD equivalent of the LAD program
below, which you have implemented in the previous practical
session. We need to use the Assignment blocks in order to set
and reset the values of coils according to the contact state.

IndustrialAutomation(ROBT308) Spring2016

AssigningvariablesinFBD
Click on the Assignment icon (1) in the toolbar and insert the
block in the program (2). You have to create the tags for the
input and output variable. The logic at the input of the block (3)
will be assigned to the variable name on top of the block (4).
1

4
3

IndustrialAutomation(ROBT308) Spring2016

AssigningvariablesinFBD
Assign the On_Off_Switch name to the input variable and define
the tag (1). Assign On to the output variable and define the
corresponding tag (2). Insert a Negative assignment block from the
basic instruction into your program (3).

IndustrialAutomation(ROBT308) Spring2016

AssigningvariablesinFBD
Assign the Off name to the output variable of the Negative
assignment and define the tag (1). Your program should be
similar to the one shown below (2).

IndustrialAutomation(ROBT308) Spring2016

Extendingtheexampleinthe
previoussession
In this session you will create an additional program that controls a
simple station for pasteurizing milk. You will work with HMI later.
The station consists of a conveyor and a heating chamber. The
conveyor drive is controlled by the three light barriers (light sensors):
The first light barrier (LS1) is activated when a milk bottle stands at
the start of the conveyor. The conveyor drive is switched on and
the bottle is moved into the heating chamber.

IndustrialAutomation(ROBT308) Spring2016

10

Extendingtheexampleinthe
previoussession
The second light barrier (LS2) detects the position of a milk bottle
in the heating chamber. It signals that the conveyor has to be
stopped and for the heating to be switched on in the chamber. In
the heating chamber the bottles are heated for 10 seconds. A
status light stays illuminated as long as the heating is on. When the
heating process is complete, the conveyor drive is restarted and
the bottle is transported to the end of the conveyor.

IndustrialAutomation(ROBT308) Spring2016

11

Extendingtheexampleinthe
previoussession
When a bottle reaches the end of the conveyor a third
light barrier (LS3) is activated and the conveyor stops.
The bottle can then be collected by the next station.
The switching on and off of
the complete station is
controlled by the button that
was programmed in the first
part of the project.

IndustrialAutomation(ROBT308) Spring2016

12

Programmingtheconveyordrivein
FBD

The program for controlling the


operation of the conveyor is
provided here in the LAD form
(1). We want to develop the
same logic in FBD.

IndustrialAutomation(ROBT308) Spring2016

13

Programmingtheconveyordrivein
FBD
Insert a Set/reset flipflop (SR) block (1) into network 2 of the
program (2), from the Bit logic operations.

2
1

IndustrialAutomation(ROBT308) Spring2016

14

Programmingtheconveyordrivein
FBD
Create the block diagram shown below by adding the And logic operation
(1) and Or logic operation (2) blocks (which can be found in the Bit logic
operations) to the program and defining the corresponding tags (3).

Define
Conveyor_On_Off
tag for the SR block
(4).

3
3

IndustrialAutomation(ROBT308) Spring2016

15

Programmingtheconveyordrivein
FBD
The conveyor is set into motion when the signal state of the "On"
tag is "1" and at least one of the following conditions applies:
A bottle is detected by the light barrier (LS1) at the start of the
conveyor and the heating chamber is switched off. In this case
the "LS_1" tag supplies the signal state "1" and the
"chamber_On_Off" tag the signal state "0".
The milk bottle has been pasteurized. In this case the
"milk_pasteurized" tag has the signal state "1". The bottle is
transported to the end of the conveyor.
When
the
conveyor
is
set
into
motion,
the
"conveyor_drive_On_Off" tag has the signal state "1".

IndustrialAutomation(ROBT308) Spring2016

16

Programmingtheconveyordrivein
FBD

AddoneOrlogicoperationblockfortheR1inputoftheSR block(1).We
needtohavethreeinputsforthisOr block,bydefaultthereareonlytwo
inputs.
In order to increase the number of the
inputs of the Or block, just click on the
yellow star (2) at the corner of the
block. One input will be added to the
block afterwards (3).
1
2

IndustrialAutomation(ROBT308) Spring2016

17

Programmingtheconveyordrivein
FBD
Insert one And logic
operation
block
(1),
connect its inputs to
LS_2
(2)
and
milk_pasteurized
(3),
and its output to the input
of the Or logic operation
(4) block. The overall
program should be similar
to the one shown here.

1
2

IndustrialAutomation(ROBT308) Spring2016

18

Programmingtheconveyordrivein
FBD
The conveyor is stopped when the signal state of the tag "Off is "1"
or at least one of the following conditions applies:
The bottle was detected by the light barrier (LS2) in the heating
chamber and the milk is not yet pasteurized. In this case the
"LS_2" tag supplies the signal state "1" and the
"milk_pasteurized" tag the signal state "0".
The bottle was detected by the light barrier (LS3) at the end of the
conveyor. In this case the "LS_3" tag has the signal state "1".
When the conveyor is stopped, the tag "conveyor_drive_On_Off"
has the signal state "0".

IndustrialAutomation(ROBT308) Spring2016

19

Programmingtheheatingchamber
controlinFBD
In order to control the heating chamber, you can use an SR block
(1), set its output variable as Chamber_On_Off, connect its Set
input to LS_2 and its Reset input to the output of the Or logic
operation block, as shown below.

IndustrialAutomation(ROBT308) Spring2016

20

Programmingthetimingofheating
chambercontrolinFBD
In the LLD programing (1), we need a TON block, one contact and
one coil to program the timing of the heating chamber. In FBD (2),
you can use one TON block and one Assignment block to do the
same task.
1

IndustrialAutomation(ROBT308) Spring2016

21

Programmingthetimingofheating
chambercontrolinFBD
When a milk bottle activates the light barrier "LS_2",
the heating chamber is switched on and the
pasteurizing time will be started. After the end of the
period the "milk_pasteurized" tag is set to the signal
state "1". The conveyor starts to move and the milk
bottle is transported to the end of the conveyor.

IndustrialAutomation(ROBT308) Spring2016

22

ProgrammingthestatuslightinFBD
When the heating chamber is switched on, the "chamber_On_Off"
tag has the signal state "1". The "LED01" tag is set to the signal state
"1" by means of the Assignment" block. As long as the heating
chamber is switched on, the "LED01" tag has the signal state "1".
When the heating chamber is switched off, the value of the tags
"chamber_On_Off" and "LED01 changes to "0"

Compiletheprogram,Runit
andcheckthefunctionality.
IndustrialAutomation(ROBT308) Spring2016

23

Someoftheavailablefunctionblocks
There are several function blocks available in the TIA portal. Here you can see a
brief list and description for each one.
Basic instructions > General:
1.
2.
3.
4.
5.

Newnetwork(1):Toaddanew
network.
Empty box (2): To insert an empty
function block, then you can
determine its functionality.

1
3

2
4

Branch (3): When you need to use the output of one block as the input for
more than one block, you can create a branch.
Insert input (4): To increase the number of the inputs of a block. Its
functionality is the same as clicking on the star in the corner of the block.
Invert RLO (5): To negate or invert the logic value provided as the input or
output of a block. You have to click on the input/output on the block, then
click on Invert RLO.
IndustrialAutomation(ROBT308) Spring2016

24

Someoftheavailablefunctionblocks
Basic instructions > General:
Open branch (1)

Toaddabranch,selecttheoutput
ofablockbyclickingonit(2),then
clickontheOpenbranch
instruction(3)inthefavorites
menu,toaddanewnetwork.

Thenewbranchwillappearatthe
outputoftheblock(4).Nowyou
canconnectotherblockstothis
connection.
3

IndustrialAutomation(ROBT308) Spring2016

25

Someoftheavailablefunctionblocks
Basic instructions > General:
Invert RLO (1)

Toinverttheoutputofablock,
selectthatoutput(2),thenclickon
theInvertRLOinstruction(3) in
thefavoritesmenutonegatethe
output(4).
3

The output of the block will be


negated (4). Try to negate the input of
the block in the same way.
Another way is to drag the Invert RLO
from the toolbox (1) and drop it at the
inputs or outputs of the block.

IndustrialAutomation(ROBT308) Spring2016

26

Someoftheavailablefunctionblocks
Basic instructions > General:
Insert input (1)

Toincreasethenumberofinputs
ofablock,clickononeofthe
inputs(2),thenclickontheInsert
inputinstruction,(3) inthe
favoritesmenutoaddinputs(4).
3

The number of inputs of the block will


increase (4).
Another way is to drag the Insert
input from the toolbox (1) and drop it
at the inputs of the block. As you drag,
the possible drop locations will appear
(5)

2
4
IndustrialAutomation(ROBT308) Spring2016

5
27

ProgrammingtheHMIpanelforthe
extendedexample
Update your HMI design from the last practical session, in order to include the light
sensors and the heating chamber.
You can create one LED to your HMI design to show the status of the heating
chamber (you can have it blinking when the heating chamber is turned on).
Three circles can be added to show the status of the LS1, LS2 and LS3, placed on the
beginning conveyor belt, under the heating chamber and the end of the conveyor.
You can change the values of LS1, LS2 and LS3 by forcing them in order to check the
functionality of the program.

IndustrialAutomation(ROBT308) Spring2016

28

You might also like