Sie sind auf Seite 1von 24
Basic PLC Programming Copyright © 2011 Rockwell Automation, Inc. All rights reserved.
Basic PLC Programming Copyright © 2011 Rockwell Automation, Inc. All rights reserved.

Basic PLC Programming

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

Basic PLC Programming Copyright © 2011 Rockwell Automation, Inc. All rights reserved.
PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application

PLC Basics Agenda

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application Example
1. Introduction to Terms / Concepts
1. Introduction to Terms / Concepts
2. Programming a PLC
2. Programming a PLC
3. Application Example
3. Application Example
4. Hands-On Lab
4. Hands-On Lab
How did the “PLC” get started? • 1968 -> GM (Hydramatic Division) approached suppliers to

How did the “PLC” get started?

How did the “PLC” get started? • 1968 -> GM (Hydramatic Division) approached suppliers to help

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

Every change (model year) was major destruction and re-wiring.

GMGM neeneeddeedd ththee flflexexibilitibilityy ooff ““sosolidlid ssttaattee””;; aa conconttrorollllerer ththaatt
GMGM neeneeddeedd ththee flflexexibilitibilityy ooff ““sosolidlid ssttaattee””;; aa conconttrorollllerer ththaatt coucouldld bbee
GMGM neeneeddeedd ththee flflexexibilitibilityy ooff ““sosolidlid ssttaattee””;; aa conconttrorollllerer ththaatt coucouldld bbee
programmedprogrammed andand maintainedmaintained byby plantplant engineers;engineers; andand waswas ruggedrugged
programmedprogrammed andand maintainedmaintained byby plantplant engineers;engineers; andand waswas ruggedrugged
enoughenough toto withstandwithstand thethe factoryfactory environmentenvironment andand providedprovided easyeasy
enoughenough toto withstandwithstand thethe factoryfactory environmentenvironment andand providedprovided easyeasy
troubleshootingtroubleshootingtroubleshootingtroubleshooting
AAAAllenllen-llenllen--Bradley-BradleyBradleyBradley PLCPLCPLCPLC
What is a PLC ? • A solid state (electronic) device that controls output devices

What is a PLC ?

What is a PLC ? • A solid state (electronic) device that controls output devices based

A solid state (electronic) device that controls output devices based on programming and input signals.

Inputs Control Program Outputs
Inputs
Control
Program
Outputs
Two types of I/O (Inputs & Outputs) • Digital • Also called Discrete • as

Two types of I/O (Inputs & Outputs)

Two types of I/O (Inputs & Outputs) • Digital • Also called Discrete • as wo

Digital

Also called Discrete

as wo poss

Represented by “1” or “0”

Electrically:

H

t

ibl

t

t

e s a es

“0” is usually 0 Volts (AC or DC)

“1” is a fixed voltage value such as 5VDC, 24VDC, 120VAC, etc.

Technology: Relays, Triac, Transistor, MOSFET, TTL

• Technology: Relays, Triac, Transistor, MOSFET, TTL 1 0 • Analog • Has many possible states
1 0
1
0

Analog

Has many possible states between two values .

Example: Temperature sensor.

Range of values between two limits. For example:

0°F represented by “0”

100°F represented by “4095” (example)

Electrically: 4-20mA, 0-5VDC, -10 to 10VDC

(example) • Electrically: 4-20mA, 0-5VDC, -10 to 10VDC 4095 0 Copyright © 2010 Rockwell Automation, Inc.
(example) • Electrically: 4-20mA, 0-5VDC, -10 to 10VDC 4095 0 Copyright © 2010 Rockwell Automation, Inc.

4095

0

PLC Control Program • Program – Instructions used to process inputs and set outputs •

PLC Control Program

PLC Control Program • Program – Instructions used to process inputs and set outputs • Primarily

Program

Instructions used to process inputs and set outputs

Primarily written as (Relay) Ladder Diagram:

Start_Button

written as (Rela y) Ladder Dia g ram: Start_Button Light • Programs can also be written
written as (Rela y) Ladder Dia g ram: Start_Button Light • Programs can also be written
written as (Rela y) Ladder Dia g ram: Start_Button Light • Programs can also be written

Light

written as (Rela y) Ladder Dia g ram: Start_Button Light • Programs can also be written

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 is assigned to a digital output

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application

PLC Basics Agenda

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application Example
1. Introduction to Terms / Concepts
1. Introduction to Terms / Concepts
2. Programming a PLC
2. Programming a PLC
3. Application Example
3. Application Example
4. Hands-On Lab
4. Hands-On Lab
Today's applications require a high level of control capability and advanced features • Arithmetic (Addition,

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

a high level of control capability and advanced features • Arithmetic (Addition, Subtraction, Multiplication,
a high level of control capability and advanced features • Arithmetic (Addition, Subtraction, Multiplication,
a high level of control capability and advanced features • Arithmetic (Addition, Subtraction, Multiplication,

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

data between PLC’s • Sequencing • Data Manipulation • Motion and Process Control (Used for Temperature,

• Motion and Process Control

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

(Used for Temperature, Pressure, Speed, Flow regulation) Copyright © 2010 Rockwell Automation, Inc. All rights
(Used for Temperature, Pressure, Speed, Flow regulation) Copyright © 2010 Rockwell Automation, Inc. All rights
(Used for Temperature, Pressure, Speed, Flow regulation) Copyright © 2010 Rockwell Automation, Inc. All rights

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

for Temperature, Pressure, Speed, Flow regulation) Copyright © 2010 Rockwell Automation, Inc. All rights reserved. 8

8

Simple PLC Instructions (IEC 1131) • C o n t a c t s –

Simple PLC Instructions (IEC 1131)

Simple PLC Instructions (IEC 1131) • C o n t a c t s – Direct

Contacts

PLC Instructions (IEC 1131) • C o n t a c t s – Direct –

Direct

Reverse

1131) • C o n t a c t s – Direct – Reverse • Coils

Coils

Direct

Reverse

Set

Reset

• Coils – Direct – Reverse – Set – Reset S R • Instruction Blocks –
S R
S
R

Instruction Blocks

Arithmetic (+ - * / COS SIN TAN)

St i

r ng (

FIND REPLACE

, more…)

Binary (Mask, Shift)

Boolean (AND,OR,NOT,XOR)

Comparator (< > = CMP)

Counter (CTD, CTU, CTUD)

Data Conversion (ANY_TO_**)

Process (PID, SCALER, more…) ,

Time (TON,TOF,TONOFF)

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

Ladder Logic Example

Ladder Logic Example This is a very simple rung of logic, from a PLC program: Sta

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

Start Button

_

Light

rung of logic, from a PLC program: Sta rt B utto n _ Light The rung
rung of logic, from a PLC program: Sta rt B utto n _ Light The rung
rung of logic, from a PLC program: Sta rt B utto n _ Light The rung
rung of logic, from a PLC program: Sta rt B utto n _ Light The rung

The rung is read as:

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

Copyright © 2006 Rockwell

I/O Addressing Often, a descriptive name of the devic e connected to the I/O point

I/O Addressing

I/O Addressing Often, a descriptive name of the devic e connected to the I/O point is

Often, a descriptive name of the device connected to the I/O point is used in addition to, or in place of the I/O variable which describes the physical location on the controller.

Example of user-defined name
Example of
user-defined
name

Start Button

Light

_IO_Embedded_Digital_Input_0

_IO_Embedded_Digital_Output_0

Example of system-defined I/O variable
Example of
system-defined
I/O variable
g ital_In put_0 _IO_Embedded_Digital_Output_0 Example of system-defined I/O variable Copyright © 2006 Rockwell

Copyright © 2006 Rockwell

Software Introduction 12

Software Introduction

Software Introduction 12
Software Introduction 12
RAS1
RAS1

Connected Components Workbench Software

RAS1 Connected Components Workbench Software • Easy to Acquire/Install – Free Internet download • Easy to

Easy to Acquire/Install

Free Internet download

Easy to Configure

Single software for component class products

Graphical Device Configuration

Easy to Program

Extensive use of Microsoft and IEC-61131 standards

Symbolic Programming

Rockwell Automation and user-defined function blocks

Easy to Update

Software updates available via Internet

Automation and user-defined function blocks • Easy to Update – So ft ware up dat es
Automation and user-defined function blocks • Easy to Update – So ft ware up dat es

Slide 13

RAS1

updated screenshot.

Rick Sykora, 9/1/2010

RAS2
RAS2

Connected Components Workbench

Controller Software

RAS2 Connected Components Workbench Controller Software • Graphical Micro800 controller configuration • IEC 61131-3
RAS2 Connected Components Workbench Controller Software • Graphical Micro800 controller configuration • IEC 61131-3

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.

Using Programming Software (CCW)

Using Programming Software (CCW) Brief walk-through on developing program… Copyright © 2010 Rockwell Automation, Inc.

Brief walk-through on developing program…

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application

PLC Basics Agenda

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application Example
1. Introduction to Terms / Concepts
1. Introduction to Terms / Concepts
2. Programming a PLC
2. Programming a PLC
3. Application Example
3. Application Example
4. Hands-On Lab
4. Hands-On Lab
So where could you use a PLC? • Conveyor control • Printed circuit board handling

So where could you use a PLC?

So where could you use a PLC? • Conveyor control • Printed circuit board handling equipment
So where could you use a PLC? • Conveyor control • Printed circuit board handling equipment
So where could you use a PLC? • Conveyor control • Printed circuit board handling equipment

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)

– Flow monitoring for leak detection (Oil & Gas) 17 • • • Stra pp in
– Flow monitoring for leak detection (Oil & Gas) 17 • • • Stra pp in
17
17
• •

Strapping machinery / trash compactors

Palletizers

Compressor control

Amusement park rides and attractions

Compressor control Amusement park rides and attractions Hard-wired relay panels or Single Board Computers • Many,

Hard-wired relay panels or Single Board Computers

• Many, many more

relay panels or Single Board Computers • Many, many more Copyright © 2010 Rockwell Automation, Inc.
relay panels or Single Board Computers • Many, many more Copyright © 2010 Rockwell Automation, Inc.
relay panels or Single Board Computers • Many, many more Copyright © 2010 Rockwell Automation, Inc.
relay panels or Single Board Computers • Many, many more Copyright © 2010 Rockwell Automation, Inc.

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

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application

PLC Basics Agenda

PLC Basics Agenda 1. Introduction to Terms / Concepts 2. Programming a PLC 3. Application Example
1. Introduction to Terms / Concepts
1. Introduction to Terms / Concepts
2. Programming a PLC
2. Programming a PLC
3. Application Example
3. Application Example
4. Hands-On Lab
4. Hands-On Lab
Programming a PLC – Traffic Light example Now let’s take a look at a modern

Programming a PLC – Traffic Light example

Programming a PLC – Traffic Light example Now let’s take a look at a modern traffic
Programming a PLC – Traffic Light example Now let’s take a look at a modern traffic

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 Component operator interface to test the program.

Copyright © 2006 Rockwell

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

Your Lab box

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

20

For more information on the Micro800 and Connected Components Workbench , p lease visit the
For more information on the Micro800 and Connected Components Workbench , p lease visit the

For more information on the Micro800 and Connected Components Workbench, please visit the Essential Components Booth

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

21

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

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

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