You are on page 1of 40

What is a PLC?

All plant processes or machine operations are governed by established operation procedures. There are definite start-stop procedures, sequence of operation, various protections and interlocks in a machine / plant process so as to achieve safe and smooth automated operation. These procedures and sequences are called control logic . Various techniques are available to achieve this control logic. Several hardware are used . One technique is programming the logic into a controller. The combined hardware and software system is called PROGRAMMABLE LOGIC CONTROLLER or PLC.

Soft-wiring advantage of the system

High reliability
Small space requirements Great computing capabilities Reduced costs Easily expandable Ability to withstand harsh environments

History of PLCs:
PLCs were first introduced in the late 1960s. MODICON 084 ( Modular Digital Controller ) brought the world's first PLC into commercial production. In the mid70's The AMD 2901 and 2903 were quite popular in Modicon and A-B PLCs Communications abilities began to appear in approximately 1973. The first such system was Modicon's Modbus In 80's attemps were made to standardize communications with General Motor's manufacturing automation protocol(MAP). Also the size of the PLC was reduced and they were made software programmable through symbolic programming on personal computers instead of dedicated programming terminals or handheld programmers Today we have PLCs that are programmable in function block diagrams, instruction lists, C and structured text all at the same time PC's are also being used to replace PLCs in some applications

How PLC works ?


A programmable controller has a user programmable memory that reads input conditions and sets output conditions to control a machine or process through the control program stored in the memory.

Reads

Sets

Processor / Control program


Inputs Outputs

Machine / Process
Feedback Controls

Scan cycle:
Program Scan

Input Scan

Output Scan

Processor Overhead

Communications

Input Scan Program Scan Output Scan Communications Processor Overhead

Status of input Modules is read and Input image Table is updated Ladder is executed and data is updated Status of Output table is read and sent to Output Modules Information is shared between Processor and other network devices Internal housekeeping within the processor

Components of PLC system :

A PLC system basically consists of two things.

a)

The Central Processing Unit

a)

The Input / Output system

Components of PLC system :


The Central Processing Unit

The CPU retrieves , decodes , stores and processes information. It consists of three parts : Processor , Memory module & Power supply

Processor

Memory

CPU

Power Supply

Components of PLC system :


The Input / Output System

The I /O system is a part of the PLC to which all field devices are connected.The I/O system is what actually physically carries out the control commands. This system consists of two main parts.

I / O System

The Rack

I /O Modules

Understanding Inputs and Outputs:


All field devices are connected to PLC can be classified in one of the two categories : Inputs or Outputs
INPUTS are devices that supply a signal / data to PLC. Typical examples of input devices are push buttons, limit switches, transmitters etc. OUTPUTS are devices that await a signal / data fron PLC to perform a desired function. Lights, horns, motors, valves are good examples of output devices.

Switch

PLC

Understanding Inputs and Outputs:


Types of Inputs and Outputs

Input and Output devices are basically of two types. Discrete and Analog Discrete Input / Output devices have only two states ON or OFF Analog Input / Output devices can have infinite number of states.These devices can be fully OFF, partially OFF/On or fully ON. They can send / receive a verity of complex signals to / from the PLC
High Level OFF / ON Level Transmitter Low Level

PLC

What is a Project
A Project is collection of all files and information associated with the ladder logic. File structure within a project file is as follows.
Project File Transferred between Computer Processor Memory

Stored in Computer memory only

Processor File

Database files

Data Files

Program Files

File Storage:
The files in a project are divided onto two categories based on and usage.

1. Processor Files : Contains information shared between the processor and the computer

2. Database Files : Contains user entered descriptions not used by the processor. These files are stores in the computer memory only

File Storage: Processor File


The Processor File contains : Program Files & Data Table Files

Program Files : The Program files automatically included in a project include.


1. SYS 0 : A program file that contains system related information such as processor type, I/O configuration and password. This file cannot be accessed by the user.
SYS 1 : This file is reserved for the processor that contains the Sequential Function Chart ( SFC ) logic program. This file can not be used by the user until used as an SFC. LAD 2 ( Main Ladder Logic / Control Program ) : This file contains user programmed instruction that read and evaluate data.

2.

3.

Processor Files:
Data Table Files The Data Table Files store information according to data type. When a new project is created , data table files 0 - 8 are automatically created and defined.
Default File Name
OUTPUT INPUT STATUS BINARY TIMER COUNTER CONTROL INTEGER FLOATING POINT

Identifier Default File Number

0
States of O/p terminals

1
States of I/p terminals

2
Controller Operation information

3
Internal Relay Logic

4
Timer ACC, PRESE T And status values

5
Counter ACC, PRESET And status values

6
Length , position & status of application specific instructions

7
Positive and negative whole numbers

8
Positive and negative numbers that include a decimal point

Data Stored

Memory usage of Data table files:


File type Identifier File No. Max. Size of Flie in PLC 5/40 ( Words / Structures ) 128 128 128 1000 Words 3000 words / 1000 structure 3000 words / 1000 structure 3000 words / 1000 structure 1000 Words 2000 words / 1000 structure 1000 Words 1000 Words 6000 words / 1000 structure 32760 Words / 585 structure 32718 words / 399 structure 3000 words / 1000 structure 32769 Words / 780 structure Words used in overhead 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 Memory in word per Word / structure 1 / word 1 / word 1 / word 1 / word 3/ structure 3/ structure 3/ structure 1 / word 2/ structure per structure 1 / word 6/structure 56/structure 82/structure 3/structure 42/structure

Output Input Status Binary Timer Counter Control Integer Floatingpoint ASCII BCD Block Transfer Message PID SFC status ASCII string Unused

O I S B T C R N F A D BT MG PD SC ST

1 2 3 4 5 6 7 8 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 9 - 999

File numbering of Data table files:


File type
Output Input Status Binary Timer Counter Control Integer Floatingpoint ASCII BCD Block Transfer Message PID SFC status ASCII string

File No.
0 1 2 3 4 5 6 7 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999 3 - 999

Properties
This is the default file numbers User cannot assign a different file number

This is the default file numbers User can assign a any file number from 3 through 999

The maximum size of a single data table is 32K words

Processor Status File:


The S2 status file is set up in a different manner than other data files. It contains several words ( S:0, S:1 , . ) that contain specific information regarding the processor status such as :
S:0 Arithmetic Flags Bit 0 = carry Bit 1 = overflow Bit 2 = zero Bit 3 = sign

S: 1

Processor status and flags Bit 0 = RAM checksum invalid during power up Bit 1 = processor in RUN mode Bit 2 = processor in TEST mode Bit 3 = processor in PROGRAM mode Bit 5 = enabled download operation Bit 6 = enabled test edits Bit 7 = selection switch in REMOTE mode

Bit 8 = forces enabled Bit 9 = forces present Bit 10 = processor successfully burnt EEPROM Bit 11 = performing online program Bit 12 = not defined Bit 13 = user program checksum done Bit 14 = last scan of ladder or SFC Bit 15 = program started first program scan or the first scan of the next step in an SFC

S : 18 S:20 S : 21 S:23

Processor clock year , Processor clock month , Processor clock day Processor hour , Processor minute , Processor second

Types of Addressing:

Four type of addressing can be done Direct addressing

Indirect addressing
Indexed addressing Symbolic addressing

Direct addressing:

Delimiter Delimiter Bit Delimiter

X F : E . W / B
Bit Number File Type Sub element No. File Number Element / Structure No.

* For Inputs , Outputs and Status file, the File Number can be omitted

I/O Hardware Address vs. I/O Memory Address: Hardware Address


Rack No. ( 0 27 ) octal Module Type I - Input O - Output I/O Group No. ( 0 7 ) Terminal Number ( 00 07 , 10 17 ) octal

I:066/10
File Type Bit Number

Element Number ( A group of WORDS that work as a unit )

Software Address

Direct addressing:
To specify the address of a
File File type File number File type File number File Delimiter Word number File type File number File Delimiter Word number Bit Number

Parameters to be used
B 8

Word within an Integer file

Bit within an Integer file

Bit within a Binary file Bit Delimiter Bit number Bit within a Structured file

2 4 5

T Structure Number Member Delimiter Member Mnemonic

PRE

Indirect addressing:
In case if Indirect addressing the processor uses the value from the pointer address to form the indirect address.

You can indirectly address the File no., Word no. or Bit no.
The substitute address must be one of the following types: N , T, C , R , B , O or S.

Any T , C , or R address must be a word-length sub-member address such as T 4 : 0 . ACC


Pointer address is entered in brackets [ ]
Example B3 /[I:015] N[N7:0]:[N9:1] Variable Bit Number File and Word No. Explanation The word number is stored in input word 15 File No. is stored in address N7:0 and word No. is stored in N9:1

Indexed addressing:
In case of Indexed addressing th processor starts operation at base address + the offset.
Offset value is saved in the offset word in the processors status file Indexed address symbol is # Place the # character before the file-type identifier in a logical address Enter the offset value in the status file S:24 Make sure that index value, +ve / -ve, does not cause the indexed address to exceed the file type boundary When an instruction uses more than one indexed addresses the processor uses same offset for each indexed address Set the offset word to the index value you want immediately before enabling an instruction that uses an indexed address MVM MASKED MOVE Source #N7:10 00110011 Destination #N7:5 Value Base add. Source N7:10 Destination N7:5 Offset 10 10 Offset add. N7:20 N7:15

Symbolic Address
A Symbolic Address is a term or nickname that is tied to an address to identify the function of an address. Symbols such as Radiator 1 are easy to remember than actual logical address A Symbol can be up to 20 character long A Symbol can be a combination of uppercase characters ( A Z ), numbers ( 0 9 ) or special characters A Symbol cannot consist of only numbers A Symbol cannot contain spaces A symbol cannot consist of a number followed by a single letter D, O, H, or E as RS Logix interprets this as Decimal, Octal, Hexadecimal or Exponential notional value

Project Tree :
Data table files and Program files are found with other project files in the project. All files except system files are accessible here.

Project
Help Controller Program Files Data Files : SYS 0 , LAD 2 : Cross reference ,O 0, I 1, S 2, B 3, T 4, C 5, R 6, N 7, F8

Force files

Custom Data Monitors


Trends Database

Signal flow in logic controller:


Now that we have some basic understanding about PLC , its components and their functioning let us have a more detailed look at the signal flow in logic controller. Inputs from field are received by the Input modules and the Input Image tables ids updated. Ladder is executed and Output Image table is updated as per Ladder Logic. Outputs are send to field through Output Modules as per the updated Output image table.
Input module Processor Memory Output module

Data

I:000/06
I:000/06 I:001/04

O:003/07
O: 004/05 O:003/07

Input Devices

Ladder program I:000/06 O:003/07

Output Devices

I:001/04

I:001/04

O:004/05

O:004/05

Computer

Components of Input / Output System:


I / O Modules I / O modules are the physical interface between the field devices and the processor. These interfaces come in 8 bit, 16 bit or 32 bit modules. One bit corresponds to one physical input or output connection.
8 Bit Module
O OOO O OOO

16 Bit Module
O OOO OOOO OOOO OOOO

32 Bit Module
OOOO OOOO OOOO OOOO OOOO OOOO OOOO OOOO

Components of Input / Output System:


The Rack
Rack is an enclosure with slots in it that is connected to the processor. However a logical rack is formed by a defined set of inputs and outputs.

Bit Word I/O Group I/O Rack

: One terminal point for an I/O device : 16 consecutive input or output bits : One Input word + One Output word : Eight Input word + Eight Output word ( Eight Groups = 128 DI + 128 DO)

I / O Addressing:

There are three methods of dividing a chassis into Two - slot addressing One slot addressing

I / O groups.

Half - slot addressing

The different methods of I/O addressing provide flexibility in how a PLC-5 system is designed. These methods result in a trade-off between physical space and memory usage.

Two slot addressing Addressing:


Two slot addressing is used when two chassis slots equal one I/O group ( 16 DI and 16 DO ) . Two slot addressing is usually used with 8-point I/O modules.
RACK
I/O Groups 0 1 2 3 4 5 6 7

ASB MODULE

One slot addressing Addressing:


One slot addressing is used when one chassis slots equal one I/O group ( 16 DI and 16 DO ) . Two slot addressing is usually used with 16-point I/O modules.
RACK 2 RACK 3

I/O Groups

ASB MODULE

Half slot addressing Addressing:


Half slot addressing is used when one chassis slots equal two I/O group ( 32 DI and 32 DO ) . Two slot addressing is usually used with 32-point I/O modules.
RACK 2 RACK 3 RACK 4 RACK 5

I/O Groups

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

0 / 1 2/ 3

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

0 /1 2 / 3 4 / 5

6/7

ASB MODULE

Output Image table:


The first Data table file contains the Output Image Table. This section stores the ON / OFF state of output devices. Each termination of the Output modules occupies one independent Bit in any one Word of output image table. The size of the o/p image table depends on the size of processor.
Output module

O OOO OOOO OOOO OOOO

Output Image

O:001/06 To Field

Device

Data table files

Input Image table:


The second Data table file contains the Output Image Table. This section stores the ON / OFF state of input devices. Each termination in the Input modules occupies one independent Bit in any one Word of input image table. The size of the i/p image table depends on the size of processor.
Input module

1 1

O OOO OOOO OOOO OOOO

Input Image

I:001/06 From Field

Device

Data table files

Addressing summary:

Addressing Scheme
2 Slot

Description
Any mix of 8-pt modules 16-pt modules must be I/O pairs No 32-pt modules Any mix of 8 or 16 point modules 32-pt modules must be I/O pairs Any mix of 8 , 16 or 32 point modules

1 Slot Slot

Assigning Racks:
The number of Racks in a chassis depends on the chassis size and the addressing mode .

Chassis size

Addressing mode 2 slot 1 slot 1 / 2 slot

4 slot 8 slot 12 slot 16 - slot

1 / 4 rack 1 / 2 rack 3 / 4 rack 1 rack

1 / 2 rack 1 rack

1 2 3 4

rack rack rack rack

1-1/2 rack 2 rack

Assigning Racks:
When assigning rack numbers, following guidelines are to be used. One I / O rack number is eight I / O groups, regardless of the addressing mode you select You can assign from One to Four racks in your processor resident local chassis depending upon the chassis size and addressing mode You cannot split a processor-resident local I / O rack over two or more chassis or assign unused processor resident I / O groups to remote I/ / O racks. The default address of processor resident local rack is 0 You cannot split racks across remote I / O and extended-local I / O links

Summing it up:
All PLCs have a CPU and Input / Output system. They all use a control program , instructions and addressing to make the equipment in the control system do what it is supposed to do.

Every PLC does the same three things.

1. Examines its input devices

2. Executes its control program, and


3. Updates its output devices accordingly

You might also like