Upload
hoangtram
View
233
Download
5
Embed Size (px)
Citation preview
1
PLC Programming
Ladder Diagrams
Consider the diagram below showing a circuit for switching an electric motor on or off. We can redraw this diagram in a different way, using two vertical lines to represent the input power rails and connecting the rest of the circuit between them.
The power lines or rails are vertical lines with the horizontal lines like rungs of a ladder.
L NSwitch Motor
Ladder Diagram
Power Supply
L
N
Switch
MotorM
Electrical Circuit
2
• Ladder Programming
In drawing a ladder diagram the following conventions are adopted:
1. Each rung on the ladder defines one operation in the process control.
2. The ladder diagram as read from left to right from top to bottom. 3. Each rung must start with an input/s and must end with an output/s.
4. Electrical devices are shown in their normal condition.
5. A particular device can appear in more than one rung of a ladder.6. The inputs and outputs are all defined by there addresses.
PLC Programming
3
• Ladder Logic Symbols
PLC Programming
END
Normally open input contacts
Normally closed input contacts
Output device
The end rung
4
PLC Programming
• Logic FunctionsThere are many control situations requiring actions to be initiated when certain
combination of conditions is realized. For example a drill machine is only to be started when work piece is present (interlock).
– AND function
A B
Load
Supply Voltage
ANDA
B
OutputInput
Input A Input B Output
I:1/00 I:1/01 O:1/00
111
001
010
000
BAOUTPUTSINPUTS
5
PLC Programming• OR function
A
B
Load
Supply Voltage
ORA
B
Input A
Input B
Output
I:1/00
I:1/01
O:1/00
OutputInput
111
101
110
000
BA
OUTPUTSINPUTS
6
PLC Programming• NOT function
Load
Supply Voltage
NOTA
OutputInput
Input A Output
I:1/00 O:1/00
A
01
10
A
OUTPUTSINPUTS
7
• NAND function
PLC Programming
011
001
010
100
BAOUTPUTSINPUTS
A B
Load
Supply Voltage
NANDA
B
OutputInput
Input A Input B Output
I:1/00 I:1/01 O:1/00
8
PLC Programming• NOR function
011
101
110
100
BA
OUTPUTSINPUTSA
B
Load
Supply Voltage
NORA
B
Input A
Input B
Output
I:1/00
I:1/01
O:1/00
OutputInput
9
PLC Programming• XOR function
011
101
110
000
BA
OUTPUTSINPUTS
Input A
Input B
Output
O:1/00
Input A
Input B
OR
A
B AND
AND
NOT
NOT
10
• LatchingThere are often situations where it is necessary to hold an output
energized, even when the input ceases.
PLC Programming
Input A Input B Output
O:1/00
O:1/00
Output
11
PLC Programming
• Latching example
I:1/00 I:1/01
Motor
O:1/00
O:1/00
Stop Light
O:1/00
O:1/00
Run Light
O:1/01
O:1/02
END
12
PLC Programming
• Instruction Lists
Another PLC programming method, which can be considered to be the entering of a ladder program using test, is instruction lists. For this, mnemonic codes are used, each coed corresponding to a ladder element.
Branch parallel elementsORB
Connect branch elements in seriesANB
A parallel element with closed contactORN
An outputST
A parallel element with open contactOR
A series element with closed contactANDN
A series element with open contactAND
Start a rung with a closed contactLDN
Start a rung with open contactLD
DescriptionCode
13
• Instruction Lists Example:
Step Instruction
1 LD I:1/00
2 AND I:1/013 ST O:1/00
PLC Programming
Input A Input B Output
I:1/00 I:1/01 O:1/00
14
• Instruction Lists Exercise: Write the instruction list for the following ladder
diagrams:
(a)
(b)
PLC Programming
I:1/00
I:1/01
O:1/00
I:1/00
I:1/01
O:1/00
15
• Instruction Lists Exercise: Write the instruction list for the following ladder
diagrams:
(c)
(d)
PLC Programming
I:1/00 O:1/00I:1/01
I:1/00 I:1/01
O:1/00
O:1/00
I:1/00 I:1/01
16
PLC Programming
• Function Block DiagramsBasically types of diagrams used to describe logic systems. A function block is a program instruction unit which, when executed , yields one or more output values.
A
B
Q
>=1
A
B
Q
Ladder Diagram Equivalent function block diagram
17
PLC Programming
A B Q
&
A
B
Q
Ladder Diagram Equivalent function block diagram
•Function Block Diagrams
18
PLC Programming
A
Q
QB
>=1Q
A
B&
Ladder Diagram Equivalent function block diagram
•Function Block Diagrams
19
PLC Programming
A B QC D
E
Exercise: Draw the function block diagram for the following ladder programs:
a)
•Function Block Diagrams
A B QC D
E
b)
F
G
Q
20
PLC Programming
Internal Relays
In PLC’s there are elements that are used to hold data, i.e. bits, and behave like relays, being able to be switched “on” or “off” and switch other devices “on” or “off”.
Such internal relays do not exist as real world switching devices but are merely bits in the storage memory that behave in the same way as external relay output and input.
There are several terms used to describe these elements, i.e. Auxiliary relays, Flags, Markers, Coils.
21
Internal Relays
PLC Programming
In 1 In 2 IR 1
In 3
IR 1 In 4 Out 1