PLC Week 10 - Function Block Programming

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Doon Campus

PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
1 N2G 4M4

Week 10
Function Block Programming
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
2 N2G 4M4

Function Block Programming

Function Block Programming is a PLC programming language outlined in the IEC 61131-3 standard. It
is a visual programming language that ties various instruction blocks together and allows them to
execute a process based on conditional logic. Unlike ladder logic, function block is less concerned
about displaying individual logic steps and more focused on linking prebuilt logic functions together to
create a desired result.

Memory Tags Memory tags and memory usage within function block is identical to that of ladder logic .

Work Area Since function block is a graphical language it is drawn on virtual pieces of paper
(“sheets”). A single function block routine can contain multiple sheets. A piece of logic
can be spread over multiple sheets to make it more legible.

Drawing Elements Function block is broken up into five main elements; Input References, Output
References, Function Blocks, Connectors and Wires.
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
3 N2G 4M4

Function Block Programming

Input References (IRef) Provide the locations for defining the data (memory tags or constant value)
that will be feed into the function block.

Output References (ORef) Provide the locations for the function block results to be stored
(normally memory tags).

Function Blocks (Instructions) Contain the logic required to complete a specific mathematical, logical or
comparison function. Function blocks are the equivalent of instructions in
ladder logic. Some Logix 5000 operations are available only in function block
while others are not available in function block at all.

Wires Connect programming elements together by illustrating where data should be


read from or written to.

Connectors (Icon) Provide the same functionality as wires but do not draw in the line in between
the two points, allowing for a cleaner, more legible schematic.
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
4 N2G 4M4

Function Block Programming

Wires are connected to small circles on the references and function blocks. These circles are referred
to as pins. Unlike ladder logic, in most instructions, not every function block pin must be connected to
something. Function pins that are not desired can be hidden by turning off their visibility. To do this
click on the instruction ellipse box and check off the functions visibility.
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
5 N2G 4M4

Basic Function Block Instructions

AND, OR, NOT

The basic ladder instructions XIC


(normally open), XIO (normally closed)
and OUT (coil) are, by default, bit
instructions. The position you place
them in (series or parallel) determines if
the statement is an AND or OR. To
compare two words together, bit by bit,
you must use a special instruction called
an Inclusive AND or Inclusive OR.
Unlike ladder, function block has specific
instructions for each of these tasks. Bit
level comparisons use Boolean AND, OR
and NOT. Word level comparisons use
Bitwise AND, OR and NOT.
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
6 N2G 4M4

Basic Function Block Instructions

AND, OR, NOT continued


Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
7 N2G 4M4

Basic Function Block Instructions

Equal and Not Equal


Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
8 N2G 4M4

Basic Function Block Instructions

Move with Target


Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
9 N2G 4M4

Basic Function Block Instructions

On Delay and Off


Delay Timers
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
10 N2G 4M4

Basic Function Block Instructions

Count Up / Down
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
11 N2G 4M4

Basic Function Block Instructions

Greater Than
Greater Than or Equal To
Less Than
Less Than or Equal To
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
12 N2G 4M4

Basic Function Block Instructions

Add, Subtract, Multiply and Divide


Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
13 N2G 4M4

Basic Function Block Instructions


Scale
Doon Campus
PROG8075
CNTR8060
– Industrial
– PLCVisualization
2 299 Doon Valley Drive
Kitchener, Ont. Canada
14 N2G 4M4

Basic Function Block Instructions


Example of a Start / Stop
Circuit using Function Block

The Ladder Logic Equivalent

You might also like