Sie sind auf Seite 1von 19

Ladder Logic Fundamentals

•Programming languages
•Electrical Ladder Diagram
•Ladder Logic Diagram
•Ladder Logic Instructions
•Combining Instructions
•Program execution
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.
Electrical Ladder Diagrams

• Ladder logic diagrams evolved from


electrical diagrams, which represent how
electric current flows through devices to
complete an electric circuit.
PB2 Start
L1 PB1 Stop Motor
L2

Power Bus Power Bus


Auxiliary Holding
Contact
• 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.
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.
Condition Instructions Control
Instructions

Stop button Start button

Motor – M1

Auxiliary Holding
Contact
• 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.
Ladder logic Instructions
• Normally open Instruction (XIC) – Check if closed

• Normally Closed Instruction (XIO) – Check if open


Functioning of Normally Open instruction

Input Output
Input Device terminal Ladder Program terminal Output
on PLC on PLC Device
PB1

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

Input Output
Input Device terminal Ladder Program terminal Output
on PLC on PLC Device
PB1

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


False
Functioning of Normally Closed instruction

Input Output
Input Device terminal Ladder Program terminal Output
on PLC on PLC Device
PB1

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

Input Output
Input Device terminal Ladder Program terminal Output
on PLC on PLC Device- off
PB1

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


False
N. O. Push button – Not
activated

PB1
N. O. Push button –
Activated (XIC)

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

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

PB1
Data The status of instruction
Table bit
XIC XIO OTE
Logic 0 false True False

Logic 1 true False True


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
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
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

Output Latch instruction (OTL)


L

•Retentive output Instruction , turns on a bit.


•The o/p remains on even after the rung condition goes false.
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.

One-Shot Rising (OSR)


OSR

A retentive input instruction that triggers an event to occur one


time.
Example : Push_start/Push_stop operaton