MET 382 1/14/2008
Ladder Logic Fundamentals 5
Logic Functions
PLC programming is a logical procedure
In a PLC program, “things” (inputs and rungs)
are either TRUE or FALSE
If the proper input conditions are TRUE:
The rung becomes TRUE and an output action occurs
9
The rung becomes TRUE and an output action occurs
(for example, a motor turns on)
If the proper input conditions are not TRUE:
The rung becomes FALSE and an output action does
not occur
Logic Functions
(cont’d)
Ladder logic is based on the following gg
logic functions:
AND
OR
Sometimes called “inclusive OR”
Exclusive OR
10
Exclusive OR
MET 382 1/14/2008
Ladder Logic Fundamentals 6
Logic Functions - AND
Ot t
Input 1
AND
Output
Input 2
Logic
Input 1 Input 2 Output
000
010
1 0 0
0 Æ False
1 Æ True
11
( )
Contacts
ANDed
together
1 0 0
111
Logic Functions - OR
Ot t
Input 1
OR
Output
Input 2
O
Logic
Input 1 Input 2 Output
000
011
101
1 1 1
0 Æ False
1 Æ True
12
( )
Contacts
ORed
together
1 1 1
MET 382 1/14/2008
Ladder Logic Fundamentals 7
Logic Functions - Exclusive OR
In addition to ANDing and ORing, the Exclusive OR (XOR) is
also useful. When the inputs are DIFFERENT, the XOR
ttit
Output
Input 1
Input 2
XOR
Logic
output is true.
13
Input 1 Input 2 Output
000
011
101
110
0 Æ False
1 Æ True
Logic Functions (cont’d)
Example 1 – Inputs ANDed together in series
Inputs Output
14
Three input instructions ANDed together.
All 3 input instructions must be
true in order to energize the output
MET 382 1/14/2008
Ladder Logic Fundamentals 8
Logic Functions
(cont’d)
Example 2 – Inputs ORed together in parallel
Inputs Output
15
Three input instructions ORed together.
If any of the 3 input instructions are
true the output will be energized
Logic Functions
(cont’d)
Example 3 – A combination of ANDing and ORing
16
MET 382 1/14/2008
Ladder Logic Fundamentals 9
Logical Continuity
Logical continuity in a ladder rung occurs when
Logical continuity in a ladder rung occurs when
there is a continuous path of TRUE conditions
from the left power rail to the output instruction(s)
When there is logical continuity, the rung
becomes true and the output becomes energized
17
becomes true and the output becomes energized
Logical Continuity – Example 1
Rung 0 T
Rung False
FT
Rung 1
Rung False
RT
F
This input instruction is false
This input instruction is true
18
Rung 2
Left power rail Right power rail
FTT
Rung True
T
MET 382 1/14/2008
Ladder Logic Fundamentals 10
Logical Continuity – Example 2
Virtual power flow (not actual current flow)
Rung true
due to this
branch
Path of logical continuity
19
TRUE conditions are highlighted in green
on the programming panels display
Æ PLCPLC--5 Systems5 Systems
Logical Continuity vs.
Electrical Continuity
Electrical continuity in an input circuit, occurs when thereElectrical continuity in an input circuit, occurs when there
is a complete path for current to flow.
A PLC input circuit is a simple series circuit consisting of a:
Power supply,
Switch, and a
Load
20
When there is electrical continuity, a bit in the PLCs
memory (sometimes called the input image table) is set to
a 1.
MET 382 1/14/2008
Ladder Logic Fundamentals 11
Electrical Continuity
Normally open (N.O.) pushbutton [shown pushed]
+24v COM
Input Module
Input
Circuitry
21
Electrical Continuity
+24v COM
Input Module
+
-
Power supply is implied
Input Module
Input
Circuitry
Screw terminals
22
Power railPower rail
MET 382 1/14/2008
Ladder Logic Fundamentals 12
Logical vs. Electrical Continuity
Note: It’s possible to have electrical continuity and not
have logical continuity (and vise versa).
PB0 - N.O. pushbutton
(shown pushed)
This instruction is false when
the pushbutton is pushed
I PB0
Ladder Program:Control Wiring Diagram:
23
Electrical Continuity
( )
No Logical Continuity
I_PB0
I/O Mapping
Every discrete input is assigned to a specific bit
in the PLC’s memory (input image table)in the PLC’s memory (input image table)
If there is electrical continuity, the bit is set to a 1
If there is no electrical continuity, the bit is reset to a 0
Every discrete output is assigned to a specific bit
in the PLC’s memory (output image table)
24
in the PLC s memory (output image table)
In order for an output to turn on, its associated bit
must first be set to a 1
MET 382 1/14/2008
Ladder Logic Fundamentals 13
00
02
0406
10
121416
1 word (16 bits)
PLC Data Table
Input Image Table
(only 1 word shown)
input, PB1
Input
module
Note: Bit addresses
are given in octal for
an Allen-Bradley
PLC-5 system
The bits are
0 000000000000000
0103
05
0711
13
15
17
Output Image Table
(only 1 word shown)
input, PB1
output , LT1
I:XXX/10
numbered 0 – 17
25
0 000000000000000
00
01
02
03
04
05
06
07
10
11
12
13
14
15
16
17
(only 1 word shown)
output , LT1
R
Output Module
O:XXX/01
Æ PLCPLC--5 Systems5 Systems
I/O Mapping
Input Image Table
Output Image Table in
RSLogix 5 software
26
in RSLogix 5 software
Æ PLCPLC--5 Systems5 Systems
MET 382 1/14/2008
Ladder Logic Fundamentals 14
I/O Mapping
Output Image Table in RSLogix 5:
O:005 is a 16 bit
word address:
O:005/07 is the
27
Æ PLCPLC--5 Systems5 Systems
address of a bit
which resides in
the word O:005
I/O Mapping
Input Image Table in RSLogix 5:
1 word = 16 bits (bits are
numbered in octal for a PLC-5)
28
Æ PLCPLC--5 Systems5 Systems
Không có nhận xét nào:
Đăng nhận xét