programming plcs using ladder logic. presentation outline review of ladder programming review of...

48
Programming PLCs Programming PLCs using LADDER Logic using LADDER Logic

Upload: erick-roberts

Post on 29-Dec-2015

398 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Programming PLCs Programming PLCs

using LADDER using LADDER

LogicLogic

Page 2: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Presentation OutlinePresentation Outline

Review of Ladder ProgrammingReview of Ladder Programming

Keyence PLC Ladder BuilderKeyence PLC Ladder Builder

Example 1: Motor ControlExample 1: Motor Control

Example 2: Drill ControlExample 2: Drill Control

Example 3: Traffic LightExample 3: Traffic Light

Page 3: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Programming the PLCProgramming the PLC

Ladder Logic DiagramsLadder Logic Diagrams

Function Block DiagramsFunction Block Diagrams

Sequential Function ChartsSequential Function Charts

Instruction ListInstruction List

Structured TextStructured Text

High-Level LanguageHigh-Level Language

Page 4: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

PLC Scan CyclePLC Scan Cycle

ReadReadInputsInputs

ExecuteExecuteProgramProgram

UpdateUpdateOutputsOutputs

Page 5: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Ladder Logic ExecutionLadder Logic Execution

Rungs of Ladder diagram are solved from Rungs of Ladder diagram are solved from Left to right and top to bottomLeft to right and top to bottom

Branches within rungs are solved top left Branches within rungs are solved top left to bottom rightto bottom right

PP SS

RR

AA

BB

DD EE

FF GG HH

II JJ KK

Left Power RailLeft Power Rail

BranchBranch

Right Power RailRight Power Rail

Ladder RungLadder Rung

Page 6: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Basic Ladder Basic Ladder ProgrammingProgramming

Page 7: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Basic Ladder Basic Ladder ProgrammingProgramming

Page 8: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Basic Ladder Basic Ladder ProgrammingProgramming

Page 9: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Basic Ladder Basic Ladder ProgrammingProgramming

TimerTimer

OutputOutput

Input TriggeredInput Triggered

Timer SettingTimer Setting

Page 10: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Keyence Ladder BuilderKeyence Ladder Builder

http://www.keyence.com/products/plc.html -> PLC Library

Free evaluation version – up to 50 timesFree evaluation version – up to 50 times KV -> PLC Series from KeyenceKV -> PLC Series from Keyence

Page 11: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Keyence Ladder BuilderKeyence Ladder Builder

StartStart -> -> Programs Programs -> -> Keyence Applications Keyence Applications ->->

Ladder Builder for KV Sample Ver.Ladder Builder for KV Sample Ver.

Page 12: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Keyence Ladder BuilderKeyence Ladder Builder

Create a new file. Select the KV10 Create a new file. Select the KV10 model.model.

Page 13: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Keyence Ladder BuilderKeyence Ladder Builder

ToolbarToolbar

Ladder Ladder EditorEditor

Page 14: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Keyence Ladder BuilderKeyence Ladder BuilderBasic Table of I/OBasic Table of I/O

KV-10KV-10

Input Input RelaysRelays

Output Output RelaysRelays

Internal Internal RelaysRelays

Timers/Timers/CountersCounters

Data Data MemoryMemory

0000 – 0000 – 00050005 0500 – 0500 – 05030503 1000 – 1000 – 19151915 T/C 000 – T/C 000 – 063063 DM 0 – DM 0 – 09990999

Page 15: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

K1K1

~~

StarStartt

StopStop

K1K1~~ ~~ ~~

M1M1

K1K1

* The overload relay has been omitted in order to * The overload relay has been omitted in order to simplify the circuitsimplify the circuit

Page 16: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Stop -> Input Relay 0000 (X000)Stop -> Input Relay 0000 (X000)

Normally Closed (NC)Normally Closed (NC) Start -> Input Relay 0001 (X001)Start -> Input Relay 0001 (X001)

Normally Open (NO)Normally Open (NO) Motor -> Output Relay 0500 (Y050)Motor -> Output Relay 0500 (Y050)

Page 17: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

ENDHENDH

ENDEND

Ladder Diagram:Ladder Diagram:

StartStart StopStop MotorMotor

MotorMotor

Page 18: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Add a normally open contactAdd a normally open contact

Select Select relayrelay00010001

Page 19: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Add a normally closed contactAdd a normally closed contact

Select Select relayrelay00000000

Page 20: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Add horizontal connection linesAdd horizontal connection lines

Page 21: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Add an output relayAdd an output relay

Select Select relayrelay05000500

Page 22: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Connect the circuit to the right power lineConnect the circuit to the right power line

Page 23: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Place the cursor below the contact of relay 0001Place the cursor below the contact of relay 0001

Add a Branch with a NO contact (OR Add a Branch with a NO contact (OR logic)logic)

Select Select relayrelay05000500

Page 24: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Place the cursor below the NO contact of relay 0500.Place the cursor below the NO contact of relay 0500.Type Type ENDEND -> for end of routine . Click -> for end of routine . Click OKOK..

Page 25: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Place the cursor below on line 0004.Place the cursor below on line 0004.Type Type ENDHENDH -> for end of program . Click -> for end of program . Click OKOK..

Page 26: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Run the simulatorRun the simulator

Page 27: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Execute the program for continuous scanExecute the program for continuous scan

Page 28: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Start the motorStart the motor(turn on and then off the start button)(turn on and then off the start button)

Change the status here andChange the status here andThen press Then press Write Current ValueWrite Current Value……

……or or double double

click with click with the the

mouse mouse left left

buttonbutton

Page 29: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Stop the motorStop the motor(watch the status of the motor – relay 0500)(watch the status of the motor – relay 0500)

Page 30: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Stop the simulation and return to the editorStop the simulation and return to the editor

Page 31: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControlUsing labelsUsing labels

Page 32: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Right click with the mouse button on the deviceRight click with the mouse button on the deviceand select and select Change LabelChange Label

Page 33: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Type the label and press OK (or Enter)Type the label and press OK (or Enter)

Page 34: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 1 – Motor Example 1 – Motor ControlControl

Type all labels (save the program – optional)Type all labels (save the program – optional)

If you use labels you can enter the device by its labelIf you use labels you can enter the device by its label(instead of its number)(instead of its number)

Page 35: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

M1M1M2M2

L1L1

L2L2

UpperUpperLimit SwitchLimit Switch

LowerLowerLimit SwitchLimit Switch

Drill MotorDrill MotorVerticalVerticalMotorMotor

(up and (up and down)down)

Page 36: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

In the beginning of the drilling cycle the Upper In the beginning of the drilling cycle the Upper Limit Switch (0001) is closedLimit Switch (0001) is closed

The START button (0000) starts the drilling cycleThe START button (0000) starts the drilling cycle The drill motor M1 (0500) must start. At the same The drill motor M1 (0500) must start. At the same

time, the vertical motor M2 must start to descend time, the vertical motor M2 must start to descend the drill (0501)the drill (0501)

The drill will stop at the Lower Limit Switch (0002).The drill will stop at the Lower Limit Switch (0002). At this time, the vertical motor start to ascend the At this time, the vertical motor start to ascend the

drill (0502).drill (0502). The drill motor must stop just at the upper The drill motor must stop just at the upper

position.position. Wait for a new drilling cycleWait for a new drilling cycle

Page 37: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

Non-retentive contacts:Non-retentive contacts:

Page 38: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

Go to Go to Help Help -> -> Instruction WordInstruction Word -> -> Instructions in Alphabetical OrderInstructions in Alphabetical Order -> -> DIFUDIFU

Page 39: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

SET – RESET instructionsSET – RESET instructions

Page 40: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

Go to Go to Help Help -> -> Instruction WordInstruction Word -> -> Instructions in Alphabetical OrderInstructions in Alphabetical Order -> -> SET SET ((RESRES))

Page 41: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

Timing diagram:Timing diagram:

STARTSTART

LIMIT1LIMIT1

MOTORMOTOR11LIMIT2LIMIT2

M2-M2-DOWNDOWNM2-UPM2-UP

Page 42: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 2 – Drill ControlExample 2 – Drill Control

Page 43: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light

Start the operation with the switch Start the operation with the switch S1 (input 0000)S1 (input 0000)

The red signal must be ON for 5 The red signal must be ON for 5 seconds (output 0500)seconds (output 0500)

The green signal must be ON for 8 The green signal must be ON for 8 seconds (output 0501)seconds (output 0501)

The yellow signal must be ON for 3 The yellow signal must be ON for 3 seconds (output 0502)seconds (output 0502)

The cycle must continues until the The cycle must continues until the switchswitch

S1 is releasedS1 is released

Page 44: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light

Go to Go to Help Help -> -> Instruction WordInstruction Word -> -> Instructions in Alphabetical OrderInstructions in Alphabetical Order -> -> TMRTMR

Page 45: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light

Page 46: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light

Place the cursor at the position you want Place the cursor at the position you want to add a Timer. Then, double click with to add a Timer. Then, double click with the mouse left button and select the mouse left button and select Instruction Instruction -> TMR-> TMR

Page 47: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light

Define the Timer number and the Preset Define the Timer number and the Preset value.value.

Timer numberTimer number

Preset valuePreset value

Page 48: Programming PLCs using LADDER Logic. Presentation Outline Review of Ladder Programming Review of Ladder Programming Keyence PLC Ladder Builder Keyence

Example 3 – Traffic LightExample 3 – Traffic Light