You are on page 1of 37

EET 319 Programmable Logic Controllers

Lecture 2
Outline for Today

Lab report format


Internal bits
Word / Bit format
Event Sequencing
Seal-in logic (review)
Latches and Interlocks (review)
Wrap up labs 1+2 tomorrow (Wed.) as needed
Homework for next week
Lab Report Format (starting with Lab 3)
Follow A Guide to Laboratory Report Writing for Digital and Processor-based
Courses (as closely as makes sense)

Emphasis is on readability (and usefulness of report for replication of results)


•Objective(s)  What did you set out to do or learn?
•Introduction  Background, uses for this, etc
•Procedure  What did you do, in your own words?
•Results  What happened, specifically?
•Conclusions  What can you conclude from these results?

Figures  Ladder logic diagrams are usually needed.


Power and I/O diagrams could be needed, too.
Grading
Write your lab reports as if your team was hired by an engineering
firm to investigate whatever phenomenon or skill or activity the lab covers.
Describe what was done, what results you got, and how you got them (so that
someone else can replicate your work.)
New idea: Internal addressing
Sometimes you might not want to use an actual physical
output, for example, in a start/stop rung whose output
instruction you might want to use in other rungs

PB (NC) PB (NO) O:2/1

O:2/1
O:2/2

O:2/1
O:2/3

O:2/1
Internal addressing
Instead of a physical output address, you can use an
internal address (essentially just a bit in memory that
indicates the state of a logical instruction)

Syntax:
B3:0/0

bit number (0 – 15)

element (word) number (0 – 255)

Bit file number (3 – 255), default is 3


file type (bit)
Example
PB (NC) PB (NO) B3:0/1

B3:0/1
O:2/1

B3:0/1
O:2/2

B3:0/1
O:2/3

B3:0/1
Word/Bit vs. Bit format
Note that some of the Motor Panel inputs override (parallel) the switches on the main panel.
Note, also, that PB2 is a normally-closed switch! (I:1/1 will be on when the switch is not pressed.)
New idea: Event-driven Sequencing

Sequence of actions that must be taken in order


A sequence is the order in which the action must
be taken
Each action is called a sequence step, or event
Example: Single Cycle Reciprocation
Initial Condition
Pushbutton pushed
Pushbutton released
Cylinder fully extended
Cylinder retracting
Cylinder retracted

Importance of failsafe operation


Electropneumatic Panel
Electropneumatic Panel

Note action

Note typos
PLC Motor Panel
PLC Motor Panel: Controls

PB-1: Normally OPEN, connected to I:1/0


PB-2: Normally CLOSED, connected to I:1/1 (e-stop)
SS-1: On/Off/On switch: I:1/2 (Left); I:1/3 (Right)
PLC Motor Panel: Motor 1
LS-1  I:1/4
LS-2  I:1/5
LS-3  I:1/6
LS-4  I:1/7

These are N/O but usually pressed, so they act like N/C.

O:2/0 makes Motor 1 turn clockwise;


O:2/1 makes Motor 1 turn counter-clockwise.
(Both outputs active at once causes the motor to just stop)
Seal-in Logic: Recap

PB (NC) PB (NO) O:2/1

O:2/1

Latches the function after pushbutton is pushed


Typical use: Pushbutton start/stop
Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

When the button is pressed…


Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

…the output goes active


(unless the E-stop is pressed.)
Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

…but the output going active means O/2:1 is true


Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

…so now, even if the start button is released,


the output stays energized. It is “sealed in.”
Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

So how do we stop it? Press the E-stop button.


Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

This breaks the chain and turns the output off…


Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

…and on the next cycle, the seal-in is turned off.


Seal-in Logic

PB (NC) PB (NO) O:2/1

O:2/1

Release the E-stop, and it’s ready to go again


once the Start button is pressed.
Seal-in Logic
(STOP) (START) (OUTPUT)

(CONTINUE);
same as output

Seal-ins are very common in ladder logic.


Learn what the various parts do, as shown here.
Logic in the (start) position is required to start.
Logic in the (STOP) position can break the cycle.
(CONTINUE) is simply the output, used as an input.
Latches
The relays we’ve seen so far go on when the
input is turned on (or off in the case of XIO)
and off (on) when the power is removed
In the days of hand wired ladder logic, if you
wanted to have the relay stay on after the
power was removed and then turn off when
another signal switched it off, you would use a
latching relay
The one on the right does this using a
clockwork escapement mechanism.

http://en.wikipedia.org/wiki/Relay#Latching_relay
Latches
In a PLC, this function is accomplished using a
latch instruction. ON O:2/5
An example is shown on the right: you use L
two rungs, one to latch and one to unlatch the
instruction.
Note that each output latch instruction has OFF O:2/5
the same address, but one latches and the U
other unlatches the output instruction.

O:2/5 Output
Usually it’s not a good idea to rely on
latches too much when you’re starting out
- non-volatile

The lab will walk you through a latch


exercise
Interlocks

Forces an output to specific state when certain conditions


are true
Typical uses: Safety, sequencing
Documentation

Good documentation is an essential part


of good programming!

Documentation types for ladder logic:


• Page title
• Address description
• Address symbol
• Instruction comment
• Rung comment
Homework (due next week*)
0. a) Review the brief video on Rockwell/Allen-Bradley devices
at http://www.youtube.com/watch?v=lBp5ag6SJH4
b) If you are rusty with Digital, review Petruzella, Chapter 3
1. Read Petruzella, Chapters 1, 2 (sections 2.1- 2.4), and 4
2. Do Chapter 1, Question 3, Problems 4 & 5* and Chapter
4, Question 4, Problems 1 & 2**

*Note that the author divides homework into “Questions” and


“Problems”
** Note that P2 is continued on the next page
Questions?

You might also like