Sie sind auf Seite 1von 214

NikiniNikiniNikiniNikini

INTRODUCTIONINTRODUCTION TOTO PROGRAMMABLEPROGRAMMABLE LOGICLOGIC CONTROLLERSCONTROLLERS
INTRODUCTIONINTRODUCTION TOTO
PROGRAMMABLEPROGRAMMABLE
LOGICLOGIC CONTROLLERSCONTROLLERS

NikiniNikiniNikiniNikini Automation Systems (Pvt.) Ltd.

Overview

NikiniNikiniNikiniNikini

• Introduction to automation technology

• Introduction to micro PLC systems

• General Structure of PLC System

• Installing PLC and configuring hardware

• CPU memory and data types

• Basic programming concepts

• Programming languages

• Programming instructions

• Programming of control systems

NikiniNikiniNikiniNikini

Automation Technology

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

What is automation?

NikiniNikiniNikiniNikini What is automation? Manual Process Mechanized Process Automation is aimed at reducing human

Manual Process

NikiniNikiniNikiniNikini What is automation? Manual Process Mechanized Process Automation is aimed at reducing human

Mechanized Process

Automation is aimed at reducing human effort in performing a task.

NikiniNikiniNikiniNikini

What is automation?

• Automation (ancient Greek: = self dictated) or industrial automation is the use of electronic controllers to control industrial machinery and processes, replacing human operators.

• It is a step beyond mechanization, where human operators are provided with machinery to help them in their jobs.

NikiniNikiniNikiniNikini

Where used?

• Production Industry

• Offices

• Buildings

used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
used? • Production Industry • Offices • Buildings • Construction Industry • Medical field • Household
• Construction Industry • Medical field • Household equipment • Aerospace Industry • ??? Introduction
• Construction Industry
• Medical field
• Household equipment
• Aerospace Industry
• ???
Introduction to PLC
© Nikini Automation Systems (Pvt) Ltd
11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Example of a Manual process

NikiniNikiniNikiniNikini Example of a Manual process Drilling machine Clamping device Work piece Manual Process of

Drilling machine

Clamping device

Work piece

Manual Process of Drilling a work piece

NikiniNikiniNikiniNikini

Processes carried out

• Keeping the work piece

• Clamp the work piece

• Drill the work piece

• Un clamp work piece

• Remove the work piece

• Sensing each operation

NikiniNikiniNikiniNikini

Elements of the manual system

• Actuators

• Decision making element

• Sensors

system • Actuators • Decision making element • Sensors Introduction to PLC © Nikini Automation Systems
system • Actuators • Decision making element • Sensors Introduction to PLC © Nikini Automation Systems
system • Actuators • Decision making element • Sensors Introduction to PLC © Nikini Automation Systems

NikiniNikiniNikiniNikini

Automating the Process:

• Step 1 :Replacement of human’s muscles (hands) by some actuators, e.g. the pneumatic cylinders

• Step 2 :Replacement of human’s brain by a logic signal processing device, e.g. PLC, electrical relay circuit.

• Step 3 :Replacement of human’s senses (eyes, ears, etc.) by some input devices (electrical sensors).

• Step 4 :Use set of instructions to control output element according to the signal inputs present.

NikiniNikiniNikiniNikini

Automated System

Drill Cylinder Limit switches/ sensors to detect end limits of cylinder movement Clamp C y
Drill Cylinder
Limit switches/
sensors to detect
end limits of
cylinder movement
Clamp
C
y
li
n
d
er
Signal Processor

Operator panel

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Industrial Automation Pentagon of Automation Introduction to PLC © Nikini Automation Systems

Industrial Automation

NikiniNikiniNikiniNikini Industrial Automation Pentagon of Automation Introduction to PLC © Nikini Automation Systems
Pentagon of Automation
Pentagon of
Automation

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Signal Processors

NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics

Hard-wired Control

NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics
NikiniNikiniNikiniNikini Signal Processors Hard-wired Control Electrical Pneumatics Hydraulic Digital Electronics

Electrical

Pneumatics

Hydraulic

Digital

Electronics

Programmable Control

Hydraulic Digital Electronics Programmable Control Programmable Logic Controller (PLC) Embedded Controller
Hydraulic Digital Electronics Programmable Control Programmable Logic Controller (PLC) Embedded Controller
Hydraulic Digital Electronics Programmable Control Programmable Logic Controller (PLC) Embedded Controller
Hydraulic Digital Electronics Programmable Control Programmable Logic Controller (PLC) Embedded Controller

Programmable Logic Controller (PLC) Embedded Controller

Micro controller (PIC)

Industrial PC

Hardwired Control & Programmable Control

• Hard-wired control

NikiniNikiniNikiniNikini

– Wiring of mechanical, electrical, electro- mechanical or electronic components to obtain desired control

• Programmable control

– Programming and reprogramming of an electronic component to obtain desired control

NikiniNikiniNikiniNikini

Introduction to PLC

What is PLC?

NikiniNikiniNikiniNikini

• PLC is an abbreviation for Programmable Logic Controller.

• PLC is a microprocessor-based electronic device.

• This equipment controls a process/ machine.

– a printing machine for printing newspapers, a bagging plant to bag cement, a press for pressing plastic-shaped parts, …

• This process occurs according to the instructions of a program in the memory of the equipment.

What is PLC?

NikiniNikiniNikiniNikini

• PLC is primarily used as an Industrial Machine Controller.

• PLC is a small, but powerful Computer which is designed for industrial Controlling.

• To control process/ Machine

for industrial Controlling. • To control process/ Machine – Sensors – Control switches (Push buttons, Switches)

– Sensors

– Control switches (Push buttons, Switches)

– Actuators (Solenoid Valves, Motor controllers)

Signal Inputs

Actuators (Solenoid Valves, Motor controllers) Signal Inputs Signal Outputs should be wired to the PLC –

Signal

Outputs

should be wired to the PLC

Program with instructions stating how the process/ machine works should be written into the PLC memory

What is PLC?

NikiniNikiniNikiniNikini

Program loaded into the memory of PLC

…routed to the machine Program with instructions PLC Machine
…routed to the
machine
Program with
instructions
PLC
Machine

NikiniNikiniNikiniNikini

Basic Principle of a PLC

ProgramProgramProgramProgram (Instructions)(Instructions)(Instructions)(Instructions)

(Instructions)(Instructions)(Instructions)(Instructions) InputInputInputInput SignalsSignalsSignalsSignals
InputInputInputInput SignalsSignalsSignalsSignals
InputInputInputInput SignalsSignalsSignalsSignals
SignalSignalSignalSignal ProcessingProcessingProcessingProcessing
SignalSignalSignalSignal ProcessingProcessingProcessingProcessing

OutputOutputOutputOutput SignalsSignalsSignalsSignals

NikiniNikiniNikiniNikini

What PLC can do?

PLCs have inbuilt

1. Logic controls

2. Timers

3. Counters

4. Analogue Signals

5. Closed loop Control

6. Arithmetic Functions…etc.

NikiniNikiniNikiniNikini

Advantages of PLC

• Greater Flexibility and reliability

– Changes to the design can easily be made on the program.

• Easy debugging

– Error detection program available.

• Low power consumption & space requirement

– Based on solid-state electronics rather than electro- mechanical technology.

• Little maintenance

– No moving parts.

NikiniNikiniNikiniNikini

Advantages of PLC

• No special programming skills required

– Computer programming knowledge is not required.

• Low Cost

– Prices of microprocessor-based devices reduced more than those of electro-mechanical devices.

• Easy Archiving & Documentation

– Programming, Parameter changes, etc. can be noted and stored in the computer and documented without effort.

NikiniNikiniNikiniNikini

Advantages of PLC

• Less project planning work

– tested programs and subprograms can be used for a number of different control setups

– but each relay control circuit has to be wired and tested from scratch

• Faster control development

– programming and wiring can be carried out in parallel

• Simpler monitoring of stations by a higher-level host computer

– a programmable logic controller can easily exchange data with the host computer

NikiniNikiniNikiniNikini

PLCs Vs Other Microprocessor Based Devices

• Modularity

– Expansion possible.

• Dedicated Input/Output Units

– Inputs & outputs can be easily connected without interfacing.

• Programmability

– User friendly. No prior computer language required.

– IEC 1131-3 Languages

• Predictability

– Designed to fail predictably. Outputs will turn off when program fails.

• Single-Source Support

– Most PLC manufacturers have complete range of input & output devices.

NikiniNikiniNikiniNikini

Major PLC manufacturers

• ABB

• Koyo

• Honeywell

• Siemens

• Modicon

• Omron

• Allen-Bradley

• General Electric

• Tesco Controls

• Panasonic (Matsushita)

• Mitsubishi

NikiniNikiniNikiniNikini

SIEMENS SIMATIC S7

• SIEMENS SIMATIC S7 consists of 3 families.

– S7-200

– S7-300

– S7-400

S7-200

NikiniNikiniNikiniNikini

S7-200 NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

S7-200

NikiniNikiniNikiniNikini

• The SIMATIC S7-200 is the CPU for the lower level performance range.

• It is available in various grades.

Th

machines and system construction.

lifi

CPU i

d f

e

d

e

s qua

or open an

l

d l

c ose

l

k

oop contro tas s

i n

– It is real time capable and offers extensive communication possibilities over a PROFIBUS or PC/PPI cable and over a free programmable interface protocol.

– The SIMATIC S7-200 offers modular extensibility and integrated PID closed loop control functions.

– The program software STEP 7 Micro/Win enables a quick introduction in the programming and configuration.

S7-300

NikiniNikiniNikiniNikini

S7-300 NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

S7-300

NikiniNikiniNikiniNikini

• The SIMATIC S7-300 family offers the automation solutions for the lower and middle performance range.

• Properties of the SIMATIC S7-300

P

85 K i

i

nstruct ons

– rogram memory up to

– Up to 1024 digital in- and outputs

– Multipoint capable interface for the configuration of smaller networks and for configuration with help of a PC/PG.

– Quick execution time in which the performance capable CPU executes 1024 binary instructions inside of 0.1 ms.

– Modular configuration and quick enhancements are possible through interface modules with an integrated back plane bus.

S7-400

NikiniNikiniNikiniNikini

S7-400 NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

S7-400

NikiniNikiniNikiniNikini

• The CPUs of the family SIMATIC S7-400 build the solutions for the middle and higher performance range (e.g. automobile and machine tool construction or instrumentation and control).

• Properties of the SIMATIC S7-400

– Program memory up to 660 K instructions.

– Up to 131056 digital in- and outputs.

– Multipoint capable interface for the configuration of smaller networks and for configuration with help of the PC/PG.

– Quick execution time that the performance capable CPU executes 1024 binary instructions inside of 0.1 µs.

– Modular configuration and quick enhancements are possible through interface modules with integrated back plane bus.

NikiniNikiniNikiniNikini

Components of a PLC system

NikiniNikiniNikiniNikini

PLC Components

InputInputInputInput ModuleModuleModuleModule
InputInputInputInput ModuleModuleModuleModule
PLCPLCPLCPLC ---- ProgramProgramProgramProgram
PLCPLCPLCPLC ---- ProgramProgramProgramProgram
CentralCentralCentralCentral ProcessingProcessingProcessingProcessing UnitUnitUnitUnit
CentralCentralCentralCentral ProcessingProcessingProcessingProcessing
UnitUnitUnitUnit

OutputOutputOutputOutput ModuleModuleModuleModule

ProcessingProcessingProcessingProcessing UnitUnitUnitUnit OutputOutputOutputOutput ModuleModuleModuleModule
OutputOutputOutputOutput ModuleModuleModuleModule SensorsSensorsSensorsSensors
SensorsSensorsSensorsSensors
SensorsSensorsSensorsSensors
ModuleModuleModuleModule SensorsSensorsSensorsSensors ActuatorsActuatorsActuatorsActuators Introduction to PLC

ActuatorsActuatorsActuatorsActuators

NikiniNikiniNikiniNikini

Hardware Components of a PLC

• A PLC is made up of two basic sections

– Input/Output (I/O) Interface

– Central Processing Unit (CPU)

• CPU consists of two main parts

– Processor

– Memory

Firmware

NikiniNikiniNikiniNikini

• Firmware is the software part, which is permanently installed and supplied by the PLC manufacturer.

• This includes fundamental system routines, used for starting the processor after the power has been switched on.

• Additionally, there is the operating system in the case of programmable logic controllers, which is generally stored in a ROM, a read-only memory, or in the EPROM.

NikiniNikiniNikiniNikini

Software Components

• Firmware

– Keeps information about hardware

– Should be stored in CPU for proper use of hardware

• Operating System

– Controls the basic functions of PLC

• User Program

– Instructions written by the user (programmer)

NikiniNikiniNikiniNikini

Structure of a S7-200 (CPU 222)

NikiniNikiniNikiniNikini Structure of a S7-200 (CPU 222 ) Introduction to PLC © Nikini Automation Systems (Pvt)

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Mode Selector Switch

• RUN

• TERM

• STOP

Mode Selector Switch • RUN • TERM • STOP Introduction to PLC © Nikini Automation Systems

NikiniNikiniNikiniNikini

Expansion Modules

NikiniNikiniNikiniNikini Expansion Modules Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48

Cartridge

NikiniNikiniNikiniNikini

• Portable EEPROM

• Battery

• Real Time Clock

• Portable EEPROM • Battery • Real Time Clock Introduction to PLC © Nikini Automation Systems

NikiniNikiniNikiniNikini

Steps to follow

• Steps to follow when using a PLC for the first time

1. Wire PLC and all the modules

2. Configure Hardware

3. PLC Programming

Wiring PLC

NikiniNikiniNikiniNikini

• Follow the instructions/ manual given by the manufacturer

• Correctl

• Find the required type of inputs (Voltage, current, etc)

• Connect all the modules and wire the modules as pre given instructions

y connect the

lies etc

,

ower su

p

pp

.

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Hardware Configuration

• Configuring connected hardware units and downloading the firmware into CPU.

• Enables CPU to identify the connected hardware modules and their capabilities. This is essential for using the modules.

• S7 200 provides facility to read the PLC rather than manually configuring each connected unit.

NikiniNikiniNikiniNikini

Hardware Configuration

1. Connect wired PLC to Computer

2. Set PLC & PG (Computer) Interface

(Identif

y

the correct connectin

cable)

g

3. Set communication with PLC

4. Configure connected components (or identify PLC type)

5. Download the settings to PLC

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

PLC Programming

NikiniNikiniNikiniNikini

Programming Concept

1. Specification: Description of the task

2. Design: Description of the solution

3. Realisation: Implementation of the solution

4. Integration/commissioning: Incorporating into environment and testing the solution

NikiniNikiniNikiniNikini

Programming Concept

1. Prepare flow chart or Ladder diagram according to the functional specifications of the machine

2. Assign Input/ Output terminal addresses to the PLC as per the wiring diagram and List of symbols

3. Write program in to the PLC using the software

4. Simulate operation and debug program (with PLC programming software,

if possible or with switches and bulbs)

,

5. Is Program correct?

– <YES>: Go to step 6

– <NO>:

Modify program and go to step 4

6. Connect external devices such as Operator panel switches, sensors of the machine, relays, solenoids, etc.

7. Trial Run monitoring the functions closely

8. Is Program correct?

– <YES>: Go to step 9

– <NO>:

Modify program and go to step 7

9. Store Program

10. Run

NikiniNikiniNikiniNikini

Prepare flow chart or ladder program Assign Input/ Output terminal addresses
Prepare flow chart or ladder
program
Assign Input/ Output terminal
addresses
Write program into PLC Simulate operation and debug program
Write program into PLC
Simulate operation and
debug program
Correct program
Correct program
PLC Simulate operation and debug program Correct program Introduction to PLC © Nikini Automation Systems (Pvt)
PLC Simulate operation and debug program Correct program Introduction to PLC © Nikini Automation Systems (Pvt)
PLC Simulate operation and debug program Correct program Introduction to PLC © Nikini Automation Systems (Pvt)
PLC Simulate operation and debug program Correct program Introduction to PLC © Nikini Automation Systems (Pvt)

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

No Is program correct? Yes
No
Is program correct?
Yes

NikiniNikiniNikiniNikini

Connect external devices
Connect external devices
Trial Run Correct program No Is program correct? Yes Store program Run
Trial Run
Correct program
No
Is program correct?
Yes
Store program
Run

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Programming Method

Console or Programming Keypad

Programming Method Console or Programming Keypad Peripheral Device Connecting Cable Link with Console /

Peripheral Device Connecting Cable

or Programming Keypad Peripheral Device Connecting Cable Link with Console / Programming Keypad PLC Programming

Link with Console / Programming Keypad

PLC

Connecting Cable Link with Console / Programming Keypad PLC Programming Software Computer Link with Computer

Programming

Software

Computer

/ Programming Keypad PLC Programming Software Computer Link with Computer Introduction to PLC © Nikini
/ Programming Keypad PLC Programming Software Computer Link with Computer Introduction to PLC © Nikini

Link with Computer

NikiniNikiniNikiniNikini

Programming Languages

• IEC 61131-3 Languages

Ladder diagram (LD)

Function block diagram (FBD)

Instruction list (IL)

Structured text (ST)

Sequential function chart (SFC)

NikiniNikiniNikiniNikini

Comparison of Programming Methods

Graphical Programming (LD, FBD, SFC)

• Windows-based graphical programming environment on a computer, to compose the ladder diagram.

• Equipped with good monitoring tools and programming aids.

• Good for program development.

Mnemonic Code Programming (IL, ST)

• Compact handheld device to key in programming instructions in mnemonic codes.

• Ideal for on-site debugging and minor circuit modification.

• Requires knowledge of the programming codes.

NikiniNikiniNikiniNikini

Ladder Diagram Programming

Example

NikiniNikiniNikiniNikini

• Actuation of a push button (S1) is to cause a lamp (B1) to be switched on.

• The lamp is to be illuminated as long as the push button is actuated .

S1 B1
S1
B1

YES Function

NikiniNikiniNikiniNikini

+24V

START
START
YES Function NikiniNikiniNikiniNikini +24V START 0V Electrical Circuit Input Output 0 (Off) 0 (Off) 1 (On)

0V

Electrical Circuit

Input

Output

0 (Off)

0 (Off)

1 (On)

1 (On)

Truth Table

© Nikini Automation Systems (Pvt) Ltd
© Nikini Automation Systems (Pvt) Ltd

NikiniNikiniNikiniNikini

Introduction to PLC

11/19/2010 8:48 AM

YES Function

NikiniNikiniNikiniNikini

YES Function NikiniNikiniNikiniNikini Ladder Diagram Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Ladder Diagram

NikiniNikiniNikiniNikini

Symbolic Addressing

• For symbolic addressing, the symbol table must be filled in.

• Select the symbol table from the operations tree or by selecting Symbol table in the View menu.

tree or by selecting Symbol table in the View menu. Introduction to PLC © Nikini Automation

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Symbol Table

• A window is displayed in which you can edit the symbol table.

• Enter the element that you want to appear as plain text later on under “name”.

• Under address, enter the operand that you want to have replaced by a symbolic name.

• Under comment, you can enter a text that you find helpful.

Under comment, you can enter a text that you find helpful. Introduction to PLC © Nikini

NikiniNikiniNikiniNikini

Ladder Diagram

• The ladder programs allow the CPU to emulate the flow of electric current from a power source through a series of logical input conditions that in turn enable logical output conditions.

• The logic is separated into networks.

• The program is executed as dictated by the program, one network at a time, from left to right and then top to bottom.

• Once the CPU has reached the end of the program, it starts over again at the top of the program.

NikiniNikiniNikiniNikini

Elements of Ladder Diagram

Contacts Represent a switch through which power can flow.

Contacts Represent a switch through which power can flow. Coils Represent a relay or output that
Contacts Represent a switch through which power can flow. Coils Represent a relay or output that

Coils Represent a relay or output that is energized by power flow.

Boxes Represent a function (for instance, a timer, counter, or mathematical operation) that is executed when power flow reaches the box.

• A network is composed of these elements and represents a complete circuit.

• Power flows from the left power rail (represented in the LAD editor by a vertical line on the left side of the window) through the closed contacts to energize the coils or boxes.

NikiniNikiniNikiniNikini

Example of a Ladder Program

Contact

Coil

Example of a Ladder Program Contact Coil Box Networks Introduction to PLC © Nikini Automation
Box
Box

Networks

NikiniNikiniNikiniNikini

Memory Addressing

Inputs

• I0.0

• I0.1

.

.

.

.

• I0.7

Outputs

• Q0.0

• Q0.1

.

.

.

.

• Q0.5

Statements

NikiniNikiniNikiniNikini

• Control Statements

• The control statement is the smallest unit of

a PLC user of an

ro ram A statement consists

p

g

.

– operation part

– operand part

statement consists p g . – operation part – operand part (I0.0, I0.1, Q0.4) Introduction to

(I0.0, I0.1, Q0.4)

NikiniNikiniNikiniNikini

Ladder Programming Rules

• Rules about Placing Contacts

– Each network must begin with a contact.

– You cannot terminate a network with a contact

a contact. – You cannot terminate a network with a contact Introduction to PLC © Nikini
a contact. – You cannot terminate a network with a contact Introduction to PLC © Nikini

NikiniNikiniNikiniNikini

Ladder Programming Rules

• Rules about Placing Coils

– You cannot begin a network with a coil

– Coils are used to terminate a network of logic.

– A single network can have several coils as long as the coils exist on parallel branches of that particular network. Otherwise there can be only one coil per network.

– You cannot place more than one coil in a series

,

. – You cannot place more than one coil in a series , Introduction to PLC
. – You cannot place more than one coil in a series , Introduction to PLC

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Ladder Programming Rules

• Rules about Placing Boxes

– You cannot begin a network with a box.

– Boxes are used to terminate a network of logic.

– If a box has ENO, you can place further instructions after the box.

– You can have several boxes with ENO in a series on the same network.

– If a box does not have ENO, rules are similar to that of a coil.

• There cannot be more than one box in a network.

• You cannot place any instructions after it

NikiniNikiniNikiniNikini

Ladder Programming Rules

NikiniNikiniNikiniNikini Ladder Programming Rules Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010
NikiniNikiniNikiniNikini Ladder Programming Rules Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010
NikiniNikiniNikiniNikini Ladder Programming Rules Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Ladder Programming Guide

Number of contacts for I / Os , timers, counters, etc. is unlimited.

contacts for I / Os , timers, counters, etc. is unlimited. Introduction to PLC © Nikini

NikiniNikiniNikiniNikini

Ladder Programming Guide

Number of contacts to be connected in series or parallel is unlimited.

contacts to be connected in series or parallel is unlimited. Introduction to PLC © Nikini Automation
contacts to be connected in series or parallel is unlimited. Introduction to PLC © Nikini Automation

NikiniNikiniNikiniNikini

Ladder Programming Guide

An output coil name can only be assigned once. There cannot be two (or more) coils (or boxes) with same name.

cannot be two (or more) coils (or boxes) with same name . Introduction to PLC ©

NikiniNikiniNikiniNikini

Ladder Programming Guide

A network of the ladder diagram is keyed into PLC from left to right.

Programming for counter and other modules having more than one input must be performed in a pre-determined order.

than one input must be performed in a pre-determined order. Introduction to PLC © Nikini Automation

NikiniNikiniNikiniNikini

Ladder Programming Guide

Timer & counter data should be entered at the time of programming.

counter data should be entered at the time of programming. Timer call with a pre-set time

Timer call with a pre-set time of 5.5 seconds

Input/output number, step number, timer/counter values, etc. can be written with only the significant digits.

NikiniNikiniNikiniNikini

Drawing Lines

You can use the horizontal and vertical lines from the Program toolbar, or hold down the CTRL key and press the LEFT, RIGHT, UP, or DOWN ARROW key on your keyboard, to draw lines between the elements of your network and the left- hand power rail when necessary to complete a network.

left- hand power rail when necessary to complete a network. Introduction to PLC © Nikini Automation

NikiniNikiniNikiniNikini

Enter Instructions

NikiniNikiniNikiniNikini Enter Instructions Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48
© Nikini Automation Systems (Pvt) Ltd
© Nikini Automation Systems (Pvt) Ltd

NikiniNikiniNikiniNikini

11/19/2010 8:48 AM

Introduction to PLC

NikiniNikiniNikiniNikini

Assigning Addresses

• To assign a constant value (such as 100) or an absolute address (such as I0.1), simply type the desired value in the address area of the instruction. (Use the mouse or the ENTER key to select the address area for typing.)

or the ENTER key to select the address area for typing.) Introduction to PLC © Nikini

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Compile in LAD

• You can compile by using the toolbar buttons or the PLC menu.

can compile by using the toolbar buttons or the PLC menu. Introduction to PLC © Nikini

NikiniNikiniNikiniNikini

Example: Burglar Alarm

• A thin wire has been stretched behind a display window, which breaks if a burglary is attempted.

• A closed circuit is interrupted as a result of this and a buzzer is sounded .

is interrupted as a result of this and a buzzer is sounded . Introduction to PLC

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NOT Function

+24V

NikiniNikiniNikiniNikini NOT Function +24V START 0V Electrical Circuit Input Output 0 (Off) 1 (On) 1 (On)
NikiniNikiniNikiniNikini NOT Function +24V START 0V Electrical Circuit Input Output 0 (Off) 1 (On) 1 (On)
NikiniNikiniNikiniNikini NOT Function +24V START 0V Electrical Circuit Input Output 0 (Off) 1 (On) 1 (On)

START

NikiniNikiniNikiniNikini NOT Function +24V START 0V Electrical Circuit Input Output 0 (Off) 1 (On) 1 (On)

0V

NikiniNikiniNikiniNikini NOT Function +24V START 0V Electrical Circuit Input Output 0 (Off) 1 (On) 1 (On)

Electrical Circuit

Input

Output

0 (Off)

1 (On)

1 (On)

0 (Off)

Truth Table

NikiniNikiniNikiniNikini

NOT Function

NikiniNikiniNikiniNikini NOT Function Ladder Diagram Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Ladder Diagram

NikiniNikiniNikiniNikini

Press with protective guard

• A press stamp 1.0 is to advance only if a push button S1 is actuated and a protective guard is closed .

• If one of these conditions is not met, the press tool is to return immediately.

• The position of the closed protective guard B1 is monitored by a proximity switch B1.

protective guard B1 is monitored by a proximity switch B1. Introduction to PLC © Nikini Automation

NikiniNikiniNikiniNikini

AND Function

+24V

NikiniNikiniNikiniNikini AND Function +24V S1 S2 0V Electrical Circuit Input 1 Input 2 Output 0 0
NikiniNikiniNikiniNikini AND Function +24V S1 S2 0V Electrical Circuit Input 1 Input 2 Output 0 0

S1

NikiniNikiniNikiniNikini AND Function +24V S1 S2 0V Electrical Circuit Input 1 Input 2 Output 0 0

S2

0V
0V

Electrical Circuit

Input 1

Input 2

Output

0

0

0

0

1

0

1

0

0

1

1

1

Truth Table

NikiniNikiniNikiniNikini

AND Function

NikiniNikiniNikiniNikini AND Function Ladder Diagram Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Ladder Diagram

Bell system

NikiniNikiniNikiniNikini

• An apartment bell is to ring if bell button S1 at the front door is pressed or bell button S2 at the apartment door.

door is pressed or bell button S2 at the apartment door. Introduction to PLC © Nikini

OR Function

NikiniNikiniNikiniNikini

+24V Input 1 Input 2 Output 0 0 0 S1 S2 0 1 1 1
+24V
Input 1
Input 2
Output
0
0
0
S1
S2
0
1
1
1
0
1
1
1
1
0V

Electrical Circuit

Truth Table

OR Function

NikiniNikiniNikiniNikini

OR Function NikiniNikiniNikiniNikini Ladder Diagram Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Ladder Diagram

NikiniNikiniNikiniNikini

Function Block Diagram

• There are no contacts and coils, but there are equivalent instructions that appear as box instructions.

• The program logic is derived from the connections between these box instructions.

• The output from one instruction (such as an AND box) can be used to enable another instruction (such as a timer) to create the necessary control logic.

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

Example

NikiniNikiniNikiniNikini

Example NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

YES Function

NikiniNikiniNikiniNikini

YES Function NikiniNikiniNikiniNikini Functional Block Diagram Introduction to PLC © Nikini Automation Systems (Pvt)

Functional Block Diagram

NikiniNikiniNikiniNikini

NOT Function

NikiniNikiniNikiniNikini NOT Function Functional Block Diagram Introduction to PLC © Nikini Automation Systems (Pvt)

Functional Block Diagram

NikiniNikiniNikiniNikini

AND Function

NikiniNikiniNikiniNikini AND Function Functional Block Diagram Introduction to PLC © Nikini Automation Systems (Pvt)

Functional Block Diagram

OR Function

NikiniNikiniNikiniNikini

OR Function NikiniNikiniNikiniNikini Functional Block Diagram Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Functional Block Diagram

NikiniNikiniNikiniNikini

Statement List

• Statement List (STL) editor allows to create control programs by entering the instruction mnemonics.

• This text-based concept is very similar to assembly language programming.

• The CPU executes each instruction, in the order dictated by the program, from top to bottom, and then restarts at the top.

Example

NikiniNikiniNikiniNikini

Example NikiniNikiniNikiniNikini Ladder Diagram S t a t e m e n t L i s

Ladder Diagram

Statement List

YES Function

• Statement Logic

LD

I0.0

=

Q0.0

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini

NOT Function

• Statement Logic

LDN

I0.0

=

Q0.0

NikiniNikiniNikiniNikini

AND Function

• Statement Logic

LD

I0.0

A

I0.1

=

Q0.0

NikiniNikiniNikiniNikini

AND Function

• Statement Logic

LD

I0.0

LD

I0.1

ALD

=

Q0.0

OR Function

• Statement Logic

LD

I0.0

O

I0.1

=

Q0.0

NikiniNikiniNikiniNikini

OR Function

• Statement Logic

LD

I0.0

LD

I0.1

OLD

=

Q0.0

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini

LD Language

• Ladder logic is easy for beginning programmers to use.

• Graphical representation is often easy to understand, and is popular around the world.

• The LAD editor can be used with both the SIMATIC and IEC 1131-3 instruction sets.

• You can always use the STL editor to display a program created with the LAD editor.

NikiniNikiniNikiniNikini

FBD Language

• The graphical logic gate style of representation is good for following program flow.

• The FBD editor can be used with both the SIMATIC and IEC 1131-3 instruction sets.

• You can always use the STL editor to display a program created with the LAD editor.

• The expandable AND/OR boxes make it easier to draw complex input combinations.

NikiniNikiniNikiniNikini

STL Language

• STL is most appropriate for experienced programmers.

• STL sometimes allows you to solve problems that you cannot solve easily with the LAD or FBD editor.

• While you can always use the STL editor to view or edit a program that was created with the SIMATIC LAD or FBD editors, the reverse is not always true.

• You cannot always use the SIMATIC LAD or FBD editors to display a program that was written with the STL editor.

NikiniNikiniNikiniNikini

PLC Exercises

NikiniNikiniNikiniNikini

Exercise 1: NAND

S1

S2

B1

0

0

1

0

1

1

1

0

1

1

1

0

NikiniNikiniNikiniNikini

Exercise 1: NOR

S1

S2

B1

0

0

1

0

1

0

1

0

0

1

1

0

NikiniNikiniNikiniNikini

Exercise 1: X-OR

S1

S2

B1

0

0

0

0

1

1

1

0

1

1

1

0

NikiniNikiniNikiniNikini

Exercise 2-Logic

Input 1

Input 2

Input 3

Output 1

Output 2

1

1

0

1

0

0

1

1

1

0

1

0

1

0

1

1

1

1

0

1

NikiniNikiniNikiniNikini

Silo control system for two bulk materials

2A 1A
2A
1A

NikiniNikiniNikiniNikini

Silo control system for two bulk materials

A

mixing plant permits a selection between two

bulk materials per selector switch (S2).

In switch position 1 (S2 = 0 signal), bulk material

reaches a mixing container, if push button S1 is actuated simultaneously.

A

If

selector switch S2 is in position 2 (S2 = 1

signal) and push button S1 is actuated bulk material B is conveyed.

Silo A is opened via cylinder 1A (solenoid 1M1), Silo B via cylinder 2A (solenoid 2M1).

NikiniNikiniNikiniNikini

Programming Concept

1. Specification: Description of the task

2. Design: Description of the solution

3. Realisation: Implementation of the solution

4. Integration/commissioning: Incorporating into environment and testing the solution

Design steps

1. Sketch the system

NikiniNikiniNikiniNikini

2. Identify the sequence

3. Design the power circuits

4. Identify the input signals & Output Signals

5. Design the control circuit according to the control requirement

6. If there are signal overlaps, necessary actions should be taken to overcome signal overlap problems

NikiniNikiniNikiniNikini

Silo control system for two bulk materials

S2

S1

Y1

Y2

0

0

0

0

0

1

1

0

1

0

0

0

1

1

0

1

NikiniNikiniNikiniNikini

Heavy Work piece feeding

NikiniNikiniNikiniNikini Heavy Work piece feeding Introduction to PLC © Nikini Automation Systems (Pvt) Ltd

Exercise 3

NikiniNikiniNikiniNikini

A1 Y1
A1
Y1

1. Piston moves forward when “Start” button Pressed

2. Return to initial position when “Reset” button pressed

NikiniNikiniNikiniNikini

+24V 1 2 3 4 5 START RESET 24V I0 I1 I2 I3 I4 I5
+24V
1
2
3
4
5
START
RESET
24V
I0
I1
I2
I3
I4
I5
I6
I7
0V
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Y1
0V

NikiniNikiniNikiniNikini

PLC Hardware Components

NikiniNikiniNikiniNikini

Hardware Components of a PLC

• A PLC is made up of two basic sections

– Input/Output (I/O) Interface

– Central Processing Unit (CPU)

• CPU consists of two main parts

– Processor

– Memory

NikiniNikiniNikiniNikini

Input Modules

Input Modules

– Interface for input devices.

– CPU works in 5V

. Input modules convert 24V

DC (or higher voltage) to 5V DC.

– Isolate Signal given to the CPU.

– Input delay to screen input signals.

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM
NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Types of Input modules

NikiniNikiniNikiniNikini Types of Input modules • Sink-type input module interfaced with dry contact switches and PNP

• Sink-type input module interfaced with dry contact switches and PNP sensor

NikiniNikiniNikiniNikini

Types of Input modules

NikiniNikiniNikiniNikini Types of Input modules • Source-type input module interfaced with dry contact switches and NPN

• Source-type input module interfaced with dry contact switches and NPN sensor

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Output Modules

Output Modules

– The signals coming from CPU are 0V or 5V.

– Amplify and condition the output .

– Relay/ Transistor/ Triac Output.

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini

Types of output modules

NikiniNikiniNikiniNikini Types of output modules • Transistor Output (Source Type) Introduction to PLC © Nikini

• Transistor Output (Source Type)

NikiniNikiniNikiniNikini

Types of output modules
Types of output modules

• Transistor Output (Sink Type)

NikiniNikiniNikiniNikini

Types of output modules

NikiniNikiniNikiniNikini Types of output modules • Relay Output Introduction to PLC © Nikini Automation Systems (Pvt)

• Relay Output

NikiniNikiniNikiniNikini

Types of output modules

NikiniNikiniNikiniNikini Types of output modules • Triac Type Output Introduction to PLC © Nikini Automation Systems

• Triac Type Output

NikiniNikiniNikiniNikini

Types of Memory

Types of Memory

Erasing

Programming

When power is removed, Memory contents are:

RAM

Random Access Memory

Electrical

Electrical

 

Volatile

     

U i

s ng mas

k

s

i

n

 

ROM

Read Only Memory

Manufacturing

Not possible

process

 

PROM

Programmable ROM

 

EPROM

Erasable PROM

 

Non volatile

RPROM

Reprogrammable PROM

With UV light

Electrical

 

EEPROM

Electrically Erasable PROM

   

EAPROM

Electrically Alterable PROM

Electrical

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Basic Memory Areas

TheThe BasicBasic memorymemory areasareas ofof aa PLCPLC ::

CPU WorkWork MemoryMemory (RAM)(RAM) contains the executable user program ( or examp e f l
CPU
WorkWork MemoryMemory (RAM)(RAM)
contains the executable user program
( or examp e
f
l
l
og c an
i
d d
ata
bl
oc
k
s)
LoadLoad MemoryMemory
(EEPROM/RAM)(EEPROM/RAM)
SystemSystem MemoryMemory (RAM)(RAM)
Contains the entire
User Program
Block stack, Interrupt stack
Diagnostic buffer, Local data stack
process image input/output tables,
bit memory, timers, counters

PLC Memory

NikiniNikiniNikiniNikini

Bit is the abbreviation for binary digit.

– The BIT is the smallest binary (bivalent) information unit.

– It can accept a s gna status o

i

l

f “1”

.

0
0

or

0

BYTE.

– A byte has the size of 8 bits.

0 1 0 1 1 0 0 1
0
1
0
1
1
0
0
1

PLC Memory

WORD

NikiniNikiniNikiniNikini

The word length corresponds to the number from 16 binary characters.

A

d

l

a so

h

th

i

e s ze o

f 2 b

t

y es or

16

wor

as

 

MSB

LSB

1 0 1 0 0 0 0 1 1 0 1 0 0 1 0
1
0
1
0
0
0
0
1
1
0
1
0
0
1
0
0

DOUBLE-WORD

– A double-word corresponds to the word length of 32 binary characters.

MSB

LSB

1 0 1 0 0 1 0 1 1 0 1 0 0 1 0
1
0
1
0
0
1
0
1
1
0
1
0
0
1
0
0
1
0
1
1
0
1
0
1
1
0
1
1
0
1
0
0

NikiniNikiniNikiniNikini

BitBit

0
0

PLC Memory

2 0

ByteByte

MB100

WordWord

MW100

DoubleDouble WordWord

MD100

MSB

2

7

2

6

2

5

2

4

2

3

2

2

2

1

LSB

2

0

0 1 0 1 1 0 0 1
0
1
0
1
1
0
0
1
2 7 2 6 2 5 2 4 2 3 2 2 2 1 LSB 2

MS Byte

LS Byte

MS Byte

LS Byte

2 0 0 1 0 1 1 0 0 1 MS Byte LS Byte MS Byte
2 0 0 1 0 1 1 0 0 1 MS Byte LS Byte MS Byte

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Memory addressing

Bit

I 0 . 3 Area Byte Bit of Identifier Address Byte
I
0
.
3
Area
Byte
Bit of
Identifier
Address
Byte
 

0

I

 

1

0

M

 

1

0

V

 

1

0

Q

 

1

MSB

LSB

5 4 3 2 1 0 7 6
5
4 3 2
1
0
7 6

NikiniNikiniNikiniNikini

Memory addressing

• Byte/ Word/ Double word addressing

<Area><Size> <Starting byte address>

MB0

MB1

VW10

VD100

Timer and Counter addressing are different

NikiniNikiniNikiniNikini

How the Control Program Works

PLC performs the following operations repeatedly:

• Read the states of the input devices.

p (PII) register.

Co py

in ut status into the Process-Ima e In ut

g

p

• CPU execute the user program stored in the Load Memory and stores the results of the program logic in various memory areas including Process- Image Output (PIQ) register.

• Transfer status from the PIQ to the field outputs.

NikiniNikiniNikiniNikini

Scan Cycle of the PLC

One Scan Cycle

Reading the inputs Executing the program Process any communication requests
Reading the inputs
Executing the program
Process any communication requests
Writing to the outputs Executes the CPU self – test diagnostics
Writing to the outputs
Executes the CPU self – test diagnostics

NikiniNikiniNikiniNikini

Scan Cycle of the PLC

• Reading the inputs: The S7-200 copies the state of the physical inputs to the process-image input register.

• Executing the control logic in the program: The S7-200 executes the instructions of the program and stores the values in the various memory areas.

• Processing any communication requests: The S7-200 performs any tasks required for point-to-point or network communications.

• Executing the CPU self-test diagnostics: The S7-200 ensures that the firmware, the program memory, and any expansion modules are working properly.

• Writing to the outputs: The values stored in the process-image output register are written to the physical outputs.

NikiniNikiniNikiniNikini

• The execution of the scan cycle is dependent upon whether the S7-200 is in STOP mode or in RUN mode. In RUN mode, your program is executed; in STOP mode, your program is not executed.

is executed; in STOP mode, your program is not executed. Introduction to PLC © Nikini Automation
is executed; in STOP mode, your program is not executed. Introduction to PLC © Nikini Automation

Introduction to PLC

© Nikini Automation Systems (Pvt) Ltd

11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

PLC scan cycle time

• The time that the processor requires for this execution is called a cycle time.

• This time is de endent on the number

p

instructions and types of commands.

• Also cycle time is dependent on CPU speed and I/O conversion time delay

Exercise 4

NikiniNikiniNikiniNikini

1M1
1M1
Exercise 4 NikiniNikiniNikiniNikini 1M1 1B2 1. Piston moves forward when “ Start ” button Pressed 2.
Exercise 4 NikiniNikiniNikiniNikini 1M1 1B2 1. Piston moves forward when “ Start ” button Pressed 2.

1B2

1. Piston moves forward when “Start” button Pressed

2. Return to initial position automatically when piston moved to 1B2

NikiniNikiniNikiniNikini

+24V 1 2 3 4 5 START A2 24V I0 I1 I2 I3 I4 I5
+24V
1
2
3
4
5
START
A2
24V
I0
I1
I2
I3
I4
I5
I6
I7
0V
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Y1
0V

Exercise 5

NikiniNikiniNikiniNikini

1M1
1M1
Exercise 5 NikiniNikiniNikiniNikini 1M1 1B1 1B2 1. Piston moves forward when it reaches to 1B1 2.

1B1

Exercise 5 NikiniNikiniNikiniNikini 1M1 1B1 1B2 1. Piston moves forward when it reaches to 1B1 2.

1B2

1. Piston moves forward when it reaches to 1B1

2. Return to initial position automatically when piston moved to 1B2

3. Continuous cycle starts with “S1” (Start) push button

4. Continuous cycle stops with “S2” (Stop) push button

NikiniNikiniNikiniNikini

+24V 1 3 4 5 6 7 START RESET A1 A2 24V I0 I1 I2
+24V
1
3
4
5
6
7
START
RESET
A1
A2
24V
I0
I1
I2
I3
I4
I5
I6
I7
0V
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Y1
0V

Counters

NikiniNikiniNikiniNikini

Counters

NikiniNikiniNikiniNikini

• Up Counter (CTU)

• Down Counter (CTD)

• Up-Down Counter (CTUD)

NikiniNikiniNikiniNikini

Up Counter

• Counts up from the current value each time the count-up input CU makes the transition from off to on.

• When the current value (Cxxx) is greater than or equal to the Preset Value (PV), the counter bit (Cxxx) turns on.

• The counter is reset when the Reset (R) input turns on, or when the Reset instruction is executed.

• The counter stops counting when it reaches the maximum value (32,767).

• Counter ranges:Cxxx=C0 through C255

NikiniNikiniNikiniNikini

Example-LAD

NikiniNikiniNikiniNikini Example-LAD Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Example-FBD

NikiniNikiniNikiniNikini Example-FBD Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

Example-STL

NikiniNikiniNikiniNikini

Example-STL NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Down Counter

• Counts down from the current value of that counter each time the count down input CD makes the transition from off to on.

• When the current value Cxxx is equal to zero, the counter bit (Cxxx) turns on.

• The counter resets the counter bit (Cxxx) and loads the current value with the preset value (PV) when the load input (LD) turns on.

NikiniNikiniNikiniNikini

Example-LAD

NikiniNikiniNikiniNikini Example-LAD Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Example-FBD

NikiniNikiniNikiniNikini Example-FBD Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

Example-STL

Example-STL NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini

Up Down Counter

• Counts up each time the count-up input CU makes the transition from off to on.

• Counts down each time the count-down input CD makes the transition from off to on.

• The current value Cxx of the counter maintains the current count.

• The preset value PV is compared to the current value each time the counter instruction is executed.

• When the current value Cxx is greater than or equal to the preset value PV, the counter bit Cxx turns on.

• Otherwise, the counter bit turns off.

• The counter is reset when the Reset (R) input turns on, or when the Reset instruction is executed. The CTUD counter stops counting when it reaches PV.

Example-LAD

Example-LAD NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Example-FBD

NikiniNikiniNikiniNikini Example-FBD Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

Example-STL

Example-STL NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Timers

NikiniNikiniNikiniNikini

Timer Types

NikiniNikiniNikiniNikini

• Delay On timer (TON)

• Delay OFF timer (TOF)

• Retentive On Delay timer (TONR)

NikiniNikiniNikiniNikini

Timer Numbers

Timer Type TONR

Resolution

Maximum Time

Timer Number

 

1 ms

32.767 s

T0, T64

10 ms

327.67 s

T1-T4, T65-T68

100 ms

3276.7 s

T5-T31, T69-T95

TON, TOF

1 ms

32.767 s

T32, T96

10 ms

327.67 s

T33-T36, T97-T100

100 ms

3276.7 s

T37-T63, T101-T255

NikiniNikiniNikiniNikini

On Delay Timer

• Counts time when the enabling input is ON.

• When the current value (Txxx) is greater than or equal to the preset time (PT), the timer bit is ON.

• Current value is cleared when the enabling input is OFF.

• This timer continues counting after the Preset is reached, and it stops counting at the maximum value of 32767.

Example-LAD

NikiniNikiniNikiniNikini

Example-LAD NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

NikiniNikiniNikiniNikini Introduction to PLC © Nikini Automation Systems (Pvt) Ltd 11/19/2010 8:48 AM

NikiniNikiniNikiniNikini

Example-FBD