You are on page 1of 24

Basic PLC

Programming

Copyright © 2011 Rockwell Automation, Inc. All rights reserved.


PLC Basics Agenda

1. Introduction to Terms / Concepts


p

2. Programming a PLC

3. Application Example

4. Hands-On Lab

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 2


How did the “PLC” get started?

• 1968 -> GM (Hydramatic Division) approached suppliers to help with a


problem:
– Relay “walls” covered the plant floor.
– Changes and Troubleshooting took weeks/months. High costs
– Everyy change
g (model
( year)
y ) was major j destruction and re-wiring.
g

GM needed
d d the
th flexibility
fl ibilit off ““solid
lid state”;
t t ” a controller
t ll th thatt could
ld bbe
programmed and maintained by plant engineers; and was rugged
enough to withstand the factory environment and provided easy
troubleshooting...
troubleshooting

 Allen
Allen--Bradley PLC

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 3


What is a PLC?

• A solid state (electronic) device that controls output devices based on


programming and input signals.

Inputs

Control
Program

Outputs
Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 4
Two types of I/O (Inputs & Outputs)

• Digital • Analog
• Also called Discrete • Has many possible states between two
• Has two possible states values
values.
• Represented by “1” or “0” • Example: Temperature sensor.
• Electrically: • Range of values between two limits. For
• “0” is usuallyy 0 Volts ((AC or DC)) example:
• “1” is a fixed voltage value such as • 0°F represented by “0”
5VDC, 24VDC, 120VAC, etc. • 100°F represented by “4095” (example)
• Technology: Relays, Triac, Transistor, • Electrically: 4-20mA, 0-5VDC, -10 to 10VDC
MOSFET TTL
MOSFET,

4095
1

0
0

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 5


PLC Control Program

• Program
– Instructions used to process inputs and set outputs
• Primarily written as (Relay) Ladder Diagram:

Start_Button Light

• Programs can also be written in other languages


– Function Block or Structured Text
• Data (Variables)
– Examples
• Start_Button is assigned to a digital input
• Light
g is assigned
g to a digital
g output
p

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 6


PLC Basics Agenda

1. Introduction to Terms / Concepts


p

2. Programming a PLC

3. Application Example

4. Hands-On Lab

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 7


Today's applications require a high
level of control capability and advanced features

• Arithmetic (Addition, Subtraction, Multiplication, Division, etc)

• Data Comparison (Equal, Greater Than or Equal, Less Than or Equal)


• Word Manipulation (Copy, Move, etc)
• Communications or Messaging data between PLC’s

• Sequencing
• Data Manipulation

• Motion and Process Control


(Used for Temperature, Pressure, Speed, Flow regulation)

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 8


Simple PLC Instructions (IEC 1131)

• Contacts • Instruction Blocks


– Arithmetic ((+ - * / COS SIN TAN))
– Direct – Binary (Mask, Shift)
– Reverse – Boolean (AND,OR,NOT,XOR)
• Coils – Comparator (< > = CMP)
– Counter (CTD, CTU, CTUD)
– Direct – Data
D t Conversion
C i (ANY_TO_**)
(ANY TO **)
– Reverse – Process (PID, SCALER, more…)
– String (FIND
(FIND, REPLACE
REPLACE, more
more…))
– Set
S t S
– Time (TON,TOF,TONOFF)
– Reset R

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 9


Ladder Logic Example

This is a very simple rung of logic, from a PLC program:

Startt_Button
Sta utto Light
g t

The rung is read as:


If the Start Button is on,, turn the Light.
g
If the Start Button is off, then turn the Light off.

Copyright © 2006 Rockwell


I/O Addressing

Often, a descriptive name of the device connected to the I/O point is used
in addition to,, or in place
p of the I/O variable which describes the physical
p y
location on the controller.
Example of
user-defined
name
Start Button Light
_IO_Embedded_Digital_Input_0
g p _IO_Embedded_Digital_Output_0
g p

Example of
system-defined
I/O variable

Copyright © 2006 Rockwell


Software Introduction

12
RAS1
Connected Components Workbench Software

• Easy to Acquire/Install
– Free Internet download
• Easy to Configure
– Single software for component
class products
– Graphical
G hi l Device
D i Configuration
C fi ti
• Easy to Program
– Extensive use of Microsoft
and IEC-61131 standards
– Symbolic Programming
– Rockwell Automation and
user-defined function blocks
• Easy to Update
–S
Software
ft updates
d t available
il bl
via Internet
Slide 13

RAS1 updated screenshot.


Rick Sykora, 9/1/2010
RAS2
Connected Components Workbench
Controller Software

• Graphical Micro800
controller configuration
• IEC 61131-3 editors
– Ladder Diagram, Function
Block, Structured Text
– User-defined function blocks
– Run-time program download
• Extensive Standard
Instruction Set
– IEC 61131-3 base
instructions with Rockwell
Automation extensions
Slide 14

RAS2 updated screenshot


Rick Sykora, 9/1/2010
Using Programming Software (CCW)

Brief walk-through on developing program…

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 15


PLC Basics Agenda

1. Introduction to Terms / Concepts


p

2. Programming a PLC

3. Application Example

4. Hands-On Lab

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 16


So where could you use a PLC?
• Conveyor control
• Printed circuit board handling equipment
• SCADA(Supervisory Control And Data Acquisition)
– Remote pump/lift station (water/wastewater)
– Flow monitoring for leak detection (Oil & Gas)
• Strapping
pp g machineryy / trash compactors
p
• Palletizers
• Compressor control
• Amusement park rides and attractions
• Hard-wired relay panels or Single Board Computers
• Many, many more

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 17


PLC Basics Agenda

1. Introduction to Terms / Concepts


p

2. Programming a PLC

3. Application Example

4. Hands-On Lab

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 18


Programming a PLC – Traffic Light example

Now let’s take a look at a modern traffic light application. With sensors to
determine the presence of a car at the various parts of the intersection, the
traffic light controller must determine the lighting sequencing and timing to
allow traffic to flow in a orderly fashion. In your lab, you will learn to
program a Micro800 to control a traffic light and use it and our PanelView
C
Component operator iinterface
f to test the
h program.

Copyright © 2006 Rockwell


Your Lab box

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 20


For more information on the
Micro800 and Connected
C
Components Workbench,
W kb h pleasel
visit the Essential Components
Booth

Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 21


Copyright © 2011 Rockwell Automation, Inc. All rights reserved.

You might also like