Tm240tre.00 Eng
Tm240tre.00 Eng
Tm240tre.00 Eng
ep
rin
no
t fo
rr
TM240
t
ep
rin
rr
t fo
Requirements
Training modules:
no
Software:
None
Hardware:
None
TM240
Table of contents
4
1.1 Objectives
1. INTRODUCTION
ep
rin
2. LADDER DIAGRAM
2.1 The history of ladder diagrams
2.3 Properties
2.4 Possibilities
8
9
5. LOGIC
10
15
21
rr
4.2 Coil
10
25
27
8. POWER FLOW
29
t fo
31
9.1 Questions
31
9.2 Exercises
32
34
no
10. SUMMARY
TM240
Introduction
1. INTRODUCTION
t fo
Fig. 1 Introduction
rr
ep
rin
no
In the chapters that follow, you will get an overview of the history,
advantages, and programming of ladder diagrams.
Examples will be given to give a better explanation of the individual
functions available.
TM240
Introduction
1.1 Objectives
ep
rin
You will learn the fundamental elements of Ladder Diagram and the
symbols for logic programming.
t fo
rr
You will be able to develop flexible Ladder Diagram programs using the
program flow control elements.
no
Fig. 2 Overview
TM240
Ladder Diagram
2. LADDER DIAGRAM
2.1 The history of ladder diagrams
ep
rin
The PLC was based around the ladder diagram, which is a schematic
representation of a logical control system based on relay circuitry.
At that time, the concept became a very fast way of quickly setting up and
programming a simple logical control system with relatively little training.
For simple logical control problems, ladder diagrams are ideal, easy to use,
and easy to master. They are probably the main reason for the phenomenal
success of PLCs in industry.
Many manufacturers base their programming systems on ladder diagrams.
Unfortunately, the lack of any open standards meant that each vendor's
system was slightly different. Many manufacturers often added "special
operations" in order to increase functionality.
rr
t fo
no
Part III, "Programming Languages for PLCs", was published in 1993 and
included the specification for PLC software. Part III covers the PLC
configuration, programming, and data storage.
IEC61131-3 addresses most of the criticisms that are aimed at traditional
PLC programming. It provides a framework for developing general PLC
programs that do not require manufacturer-specific training. Most PLC and
industrial control system manufacturers have now adopted this standard.
TM240
Ladder Diagram
ep
rin
B&R has adopted the 61131-3 standard for ladder diagram programming as
well.
2.3 Properties
2.4 Possibilities
rr
t fo
no
TM240
ep
rin
Imagine that there is a vertical supply line called a "bus bar" on the lefthand side that continuously provides power. Lines that branch out to the
right are known as "instruction lines".
t fo
rr
The ladder diagram itself consists of two basic parts. The left side holds the
condition logic, while the right side contains the instructions. The logical
combination of these conditions determines when and how an instruction
on the right side is executed. The elements on the far right side are called
coils (e.g. lamps, motors, relays, etc.).
no
TM240
3.1 Networks
ep
rin
rr
The beginning of the network is the vertical line on the left (bus bar). If
two or more circuits are connected by a vertical line, then they belong to
the same network.
Up to 50 lines and 50 columns may exist in a network. The size of a
complete ladder diagram is limited only by the amount of memory on the
PC and the controller.
no
t fo
TM240
ep
rin
rr
Type of contact
Normally open
Symbol
Normally closed
contact
t fo
Positive edge
Negative edge
no
Both edges
10
TM240
ep
rin
rr
t fo
One example where normally closed contacts are used is in the safety door
on machines. If this door is opened, the contact is interrupted and the
supply circuit is interrupted. This can be done to prevent accidents.
no
Normally open and normally closed contacts can apply to outputs and
sensors as well.
TM240
11
Outp
ep
rin
Inp
Inp
rr
t fo
no
12
TM240
Outp
ep
rin
Inp
Inp
rr
t fo
no
TM240
13
Outp
Inp
ep
rin
no
t fo
rr
14
TM240
4.2 Coil
ep
rin
The coil is one of the basic Ladder Diagram elements. It is always placed
on the right-hand side of the ladder diagram as an output. Coils can be
connected to the right of contacts or to function block outputs. At least one
coil must be present in a ladder diagram. Several parallel coils can also be
used.
Each coil can be used for digital outputs or internal variables that will later
serve as an input for an additional network in the program.
The contacts are always queried while the program is running; if logic
continuity is found, then the contact is set to TRUE.
Only Boolean variables can be assigned to coils.
Type of contact
Coil
Negated coil
Reset coil
rr
Set coil
Symbol
t fo
no
Both edges
TM240
15
4.2.1 Coil
Result
Signal
ep
rin
Signal
rr
Result
t fo
no
16
TM240
4.2.3 Set
Result
Signal
ep
rin
4.2.4 Reset
Signal
rr
Result
t fo
no
TM240
17
ep
rin
Signal
rr
Result
t fo
no
18
TM240
Signal
ep
rin
no
t fo
rr
TM240
19
ep
rin
rr
Create a program that controls the conveyor belt motor with the digital
output "gDoConvMotor" by pressing the "btnConvStart" button. Don't
connect the output directly with the input. Use the command variable
"cmdManConvMotor" as an intermediate variable as shownin the image
below.
no
t fo
20
TM240
Logic
5. LOGIC
5.1.1 AND operation
Truth table:
ep
rin
Contact 2
5.1.2 OR operation
Output
0
0
0
1
rr
Contact 1
t fo
no
Truth table:
Contact 1
Contact 2
Output
TM240
21
Logic
Fig. 23 Exclusive OR
Truth table:
ep
rin
gDiButtonRight
t fo
5.1.4 Branch
no
Fig. 24 Branch
22
TM240
Output
0
1
1
0
rr
gDiButtonLeft
Logic
5.1.5 Merge
ep
rin
rr
A single vertical line can be both a branch line and a merge line, as shown
in the image below.
no
t fo
TM240
23
Logic
ep
rin
no
t fo
rr
24
TM240
ep
rin
If the condition is TRUE, then the jump takes place. A jump label with a
unique name must be present for each jump.
t fo
Fig. 28 Jump
rr
It is used to skip over networks in the program. This allows the program
flow to be controlled efficiently. The program runtime is also reduced since
networks are jumped over if they are not required.
6.1.2 Return
no
Fig. 30 Return
TM240
25
ep
rin
no
t fo
rr
26
TM240
t fo
rr
ep
rin
icon or
no
A function block can also have "analog" inputs and outputs. The
spacebar can be used to connected a variable.
TM240
27
no
t fo
rr
ep
rin
28
TM240
Power Flow
8. POWER FLOW
ep
rin
t fo
rr
There are several different possibilities for logic continuity in this network.
no
TM240
29
rr
ep
rin
Power Flow
t fo
Unlike hard-wired relay logic, reversed power flow as shown in the image
below is not possible in PLC logic.
no
If the logic calls for the implementation of reverse flow, the user must
program it in with forward power flow to all contact elements.
30
TM240
ep
rin
What is a network?
A network consists of at least one contact and one coil (input and
output). If there is no connection between two rows, then they
belong to two different networks. Networks are executed in the order
they were programmed.
rr
t fo
The coil receives the value that results from the logical conditions
that arise.
no
TM240
31
9.2 Exercises
ep
rin
The magnet valve is switched off as soon as the permitted total weight
of the vehicle has been reached (diPressure). However, the conveyor
belt should continue to run for another 5 seconds.
no
t fo
rr
The entire system is switched off immediately when the Off button is
pressed (btnOff). If the conveyor belt is disrupted
(diConveyorMotorProtection), the magnet value and the conveyor belt
(doConveyor) should be switched off immediately. If the magnet value is
disrupted (diValveProtection), it should be closed immediately, but the
belt should run empty for another 5 seconds.
32
TM240
no
t fo
rr
ep
rin
TM240
33
Summary
10. SUMMARY
ep
rin
Fig. 39 Summary
no
t fo
rr
Using analog signals and function blocks makes it possible to create highpowered applications using Ladder Diagram. Additional program flow
control elements extend the function range.
The Automation Studio, program sequences can be traced using Power
Flow. Colors are used to display the status of lines where are currently
conducting electricity.
34
TM240
rr
ep
rin
Summary
t fo
no
TM240
35
t fo
no
Internationality
36
TM240
Contact (Headquarters)
Weblink
TM240TRE.00-ENG 0907
2007 by B&R. All rights reserved.
All trademarks presented are the property of their respective company.
We reserve the right to make technical changes.
ep
rin
rr
Summary