19
Ladder Logic Fundamentals Programming languages Electrical Ladder Diagram Ladder Logic Diagram Ladder Logic Instructions

4.Ladder Logic Programming

  • Upload
    aamya

  • View
    614

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 4.Ladder Logic Programming

Ladder Logic Fundamentals

•Programming languages

•Electrical Ladder Diagram

•Ladder Logic Diagram

•Ladder Logic Instructions

•Combining Instructions

•Program execution

Page 2: 4.Ladder Logic Programming

Programming Languages

• The most Commonly use programming language is “ladder Logic”

• Other control logic languages occasionally used to program PLC include BASIC, C and Boolean.

Page 3: 4.Ladder Logic Programming

Electrical Ladder Diagrams

• Ladder logic diagrams evolved from electrical diagrams, which represent how electric current flows through devices to complete an electric circuit.

L1 L2

Power Bus Power Bus

PB1 Stop

PB2 Start

Auxiliary Holding Contact

Motor

Page 4: 4.Ladder Logic Programming

• A rung is said to have electrical continuity when current flows uninterrupted from left to right across the rung I.e.all contacts are closed).

• Each electrical circuit in the diagram is considered a rung. Every rung has two key components – the device to be controlled. – and the conditions that affect the device.

Page 5: 4.Ladder Logic Programming

Ladder Logic Programs

• PLC Ladder logic programs resembles an electrical ladder diagram.

• Electrical ladder consists of symbls that represent real world devices while PLC ladder logic symbols represent logic instructions.

• In electrical ladder the devices are described as being open or closed(Off or On). In a ladder logic program, instructions are either true or false.

Page 6: 4.Ladder Logic Programming

Stop button Start button

Auxiliary Holding Contact

Motor – M1

Condition Instructions Control Instructions

Page 7: 4.Ladder Logic Programming

• Each ladder contains at least one control (output) instruction and usually contains one or more condition instructions (Input)

• On the right hand side , a control instruction is the operation or function that is activated/de-activated by rung logic – such as output energize (Valve, solenoid alarms , etc.) bit commands, timers, and counters.

• If logical continuity exists , the PLC energises the control output. IF it does not exist the control instruction will be off or de-energized state.

Page 8: 4.Ladder Logic Programming

Ladder logic Instructions

• Normally open Instruction (XIC) – Check if closed

• Normally Closed Instruction (XIO) – Check if open

Page 9: 4.Ladder Logic Programming

Input DeviceInput terminal on PLC

Ladder ProgramOutput terminal on PLC

Output Device

PB1

I/3 I/3 - true O/4 - true O/4 On

Input DeviceInput terminal on PLC

Ladder ProgramOutput terminal on PLC

Output Device

PB1

I/3 I/3 False O/4 - False

O/4 Off

Functioning of Normally Open instruction

Page 10: 4.Ladder Logic Programming

Input DeviceInput terminal on PLC

Ladder ProgramOutput terminal on PLC

Output Device

PB1

I/4 I/4 - true O/5 - true O/5 On

Input DeviceInput terminal on PLC

Ladder ProgramOutput terminal on PLC

Output Device- off

PB1

I/4 I/4 False O/5 - False

O/5

Functioning of Normally Closed instruction

Page 11: 4.Ladder Logic Programming

PB1

N. O. Push button – Not activated

Page 12: 4.Ladder Logic Programming

PB1

N. O. Push button – Activated (XIC)

Page 13: 4.Ladder Logic Programming

PB1

N. C. Push button – Not Activated (XIC)

Page 14: 4.Ladder Logic Programming

PB1

N. C. Push button – Activated (XIC)

Page 15: 4.Ladder Logic Programming

Data Table bit

The status of instruction

XIC XIO OTE

Logic 0 false True False

Logic 1 true False True

Page 16: 4.Ladder Logic Programming

Operational procedures

• Input address have the form I:e/b

I = Input Data file

: = Element or Slot delimiter

e = Slot no. of the input module

/ = Bit or terminal delimiter

b = terminal no. used with input device

Page 17: 4.Ladder Logic Programming

Operational procedures

• Output addresses have the form O:e/b

O = output data file

: = Element or Slot delimiter

e = Slot no. of the output

/ = bit or terminal delimiter

b = terminal number used with output

Page 18: 4.Ladder Logic Programming

Output Energize instruction (OTE)

•OTE instruction is used to turn on a bit when rung conditions are evaluated as true.

• OTE instructions are reset when when condition goes false or MCR is activated

L

Output Latch instruction (OTL)

•Retentive output Instruction , turns on a bit.

•The o/p remains on even after the rung condition goes false.

Page 19: 4.Ladder Logic Programming

Output Unlatch Instruction ( OUT)

U

•The OUT instruction is a retentive output that can only turn off a bit.

•Traditionally used in pairs with an output latch (OTL)

•It can not turn on a bit.

OSR

One-Shot Rising (OSR)

A retentive input instruction that triggers an event to occur one time.

Example : Push_start/Push_stop operaton