0% found this document useful (0 votes)
144 views

PLC Programming & Application 24-05-18

There are several methods of process control and automation including manual control, hardwired logic control, and PLC control. Manual control relies on human operators but has limitations in terms of errors, mass production, and efficiency. Hardwired logic control used contactors and relays for some automation but had limitations. PLC control uses programmable logic controllers to automate industrial processes through programming. PLCs offer benefits over previous methods such as higher productivity, quality, efficiency, and safety.

Uploaded by

abhi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views

PLC Programming & Application 24-05-18

There are several methods of process control and automation including manual control, hardwired logic control, and PLC control. Manual control relies on human operators but has limitations in terms of errors, mass production, and efficiency. Hardwired logic control used contactors and relays for some automation but had limitations. PLC control uses programmable logic controllers to automate industrial processes through programming. PLCs offer benefits over previous methods such as higher productivity, quality, efficiency, and safety.

Uploaded by

abhi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 81

PLC Programming & Application

Preface
The Centre for Research and Industrial Staff Performance (CRISP) uses a Competence
Based Approach in designing, implementing and evaluating various training
programmes conducted at its different training centres in India and abroad.

This approach requires radically different methods of curriculum development,


Instructions, preparation of Learning materials and competence certification. In the
Competence Based Approach, the focus is on development of performance abilities
at specified standards, rather than providing theoretical knowledge.

The learning materials developed at CRISP cater to the needs of the trainees at the
Planning, Process, Product and Attitudinal stages of performance. The trainers can
make judicious use of this material and integrate it with training methodology and
assessment procedures.

The Learning material is designed to be learner centred, provides underpinning


knowledge required to perform as well as the learning experiences for skills (hard
and soft skills) development.

This Learning Material is the outcome of the rich experiences of the Trainers of
CRISP, which they have acquired through problem solving situations in Industries,
personal studies, exposure to training institutes in India & other countries,
interactions with subject experts & trainees of varying qualifications & experiences,
attending programmes, workshops & seminars in their areas of expertise.

Information and data from various publications, research journals, technical


literature and the Internet has been used to provide various types of learning
experiences to the readers. It is difficult to identify and acknowledge all the sources.
We are thankful to all who have enriched the contents of the learning material
directly and indirectly.

The learning material will be used only for instructional purposes for the benefit of
the learners. No commercial use is intended for profit making or business of any kind.
We hope that the trainees will find it useful and relevant.
Suggestions and comments for improvement are most welcome.

CRISP India (Bhopal)


i
PLC Programming & Application

How to use the Learning Material

This learning package provides planned learning experiences to help you acquire the
competency designed in the training programme.

The competency is further elaborated in terms of Elements of Competence, in other


words, the elements are subsets of the competency and add up to the total
competency. Each element contains related knowledge, concepts, theories and
principles required to perform various tasks. The information is provided in small
steps to help you learn. The learning Objectives have been provided to set targets of
achievements.

The package also contains relevant exercises prepared on the basis of skill analysis.
You should practice on the exercises - the more you practice, better will be your
performance. Before proceeding further, ensure that you have mastered the
previous skills. In case of problems, consult your trainers.

Another important dimension of the Learning package is the provision of the


feedback system. You can check your progress through self tests and performance
tests which are an integral part of the package.

ii
PLC Programming & Application

Competency Statement

Develop & execute PLC programs for


various applications, debug &
troubleshoot faults in PLC based systems

3
PLC Programming & Application

Objective of Training Programme

At the end of the course participants will be able to:-

 State the benefits of automation in modern industrial application.


 Compare the performance of manual, hardwire, electronics & PLC methods of
control and automation.
 List the application of PLC & explain its working with a block diagram.
 Explain PLC Programming methods using ladder diagram, statement list and
functional block diagram.
 Develop PLC program using
o Bit logic
o Timer
o Counter
o Comparison
o Integer Function
 Run & test the programs.
 Explain the method of resetting the CPU memory.
 Explain the process of carrying out maintenance in a PLC by software and
hardware sides.
 List the possible faults & explain the methods the rectify the faults.
 Given a faulty PLC, identify and rectify the faults.
 Carryout maintenance of PLC using hardware and software methods.

4
PLC Programming & Application

Contents
Preface......................................................................................................................i
How to use the Learning Material.............................................................................ii
Competency Statement...........................................................................................iii
Objective of Training Programme............................................................................iv
1. Element -1..........................................................................................................1
Develop and Execute PLC Program for various applications......................................1
2. Element -2........................................................................................................60
Debug & troubleshoot faults in PLC Systems..........................................................60
Conclusion..............................................................................................................67
References..............................................................................................................68
Glossary & Abbreviations.......................................................................................69
Test your knowledge..............................................................................................70
Notes......................................................................................................................71

5
PLC Programming & Application

1. Element -1
Develop and Execute PLC Program for various applications
Objectives:-

At the end of this element you will be able to

 State the benefits of automation in modern industrial application.


 Compare the performance of manual, hardwire, electronics & PLC methods of
control and automation.
 List the application of PLC & explain its working with a block diagram.
 Explain PLC Programming methods using ladder diagram, statement list and
functional block diagram.
 Develop PLC program using
o Bit logic
o Timer
o Counter
o Comparison
o Integer Function
 Run & test the programs.

1
PLC Programming & Application

Process Control
The process of recognizing the state of the
process at all times, analyses the information
according to the set rules and guidelines and
accordingly actuate the control elements is
referred to as process control.

Manual Control
 In this all the actions related to process
control and automation are taken care by
the operators.
 In the control of process all these actions  One of the major drawbacks of this method
can be taken manually with human is the likely human errors and consequently
involvement or in a semiautomatic or fully its effect on quality of final product.
automatic manner.  The manual control has its own limitations
with regard to mass production techniques
Automation and hence this method cannot provide the
consumer with quality goods at an
 Automation is basically the delegation of affordable price. The safety or efficient use
human control functions to technical of raw material and energy are all subject to
equipment aimed towards achieving the correctness and accuracy of human
 Higher productivity action.
 Superior quality of end product Hard Wired Logic Control
 Efficient usage of energy and raw
materials  This was considered to be the first step
towards automation.
 Improved safety in working conditions  Here the contactor and relays together with
 Time saving. timers and counters were used in achieving
the desired level of automation.
 Although this method served the purpose
History - Process Control And for many years, it had certain limitations as
Automation listed below:

o Bulky and complex wiring.


 The various methods adopted for process
o Involves lot of rework to implement
control and automation are as follows:
changes in control logic.

2
PLC Programming & Application

o The work can be started only when the task growth as universal element in industrial
is fully defined and this leads to longer automation. It can be effectively used in
project time. applications ranging from simple control like
o High power consumption. replacing small number of relays to complex
automation problems.
Electronics Control  The important advantages listed in the
following point will explain the reasons for
With the advent of electronics, the logic gates the popularity of PLCs in control and
started replacing the relays and auxiliary automation tasks.
contactors in the control circuits.
The bimetallic and motorized timers were Advantages of PLC
replaced by electronic timers, counter.
Reduced Space
 With incorporation of these changes, we got
PLCs are fully solid state and hence extremely
the benefits of
compact as compared to hard¬-wired
controller wherein electromechanical devices
o Reduced space requirements.
are used.
o Energy saving.
o Less maintenance and hence greater Energy Saving
reliability.
o Easy fault finding. Average power consumption is just 1/10th of
power consumed by an equivalent relay logic
 However even with electronics, the control.
implementation of changes in the control
logic as well as reducing the project lead Ease of Maintenance
time was not possible.
 This method of control and automation was  Modular replacement.
also popular for quite some time.  Easy Trouble Shooting.
   Error diagnostics with programming unit.
Programmable Logic Controller
Economical
 With the coming of microprocessor and
associated peripheral chips, the whole  Considering one time investment; PLC is
process of control and automation most economical system.
underwent a radical change.  Cost of PLC recovers within a short period
(Low pay back period).
 Instead of achieving the desired control or
automation through physical wiring of Greater Life and Reliability
control devices, in PLC it is achieved through
a program or says software.  Static devices hence lesser number of
moving parts, reduces wear and tear.
 As the desired logic control is achieved  In the case of hard-wired logic, the control
through a ‘program’, these controllers are hardware is either electromechanical or
referred to as Programmable Logic pneumatic and therefore it is more prone
Controllers. to faults due to wear and tear of moving
 The Programmable Controllers have in parts resulting in lesser ON TIME of the
recent years experienced an unprecedented system.

3
PLC Programming & Application

Tremendous Flexibility  This is due to its compatibility with Hard


copy.
 To implement changes in control logic no  Pen drive, CD, DVD, and Hard disk.
rewiring is required so considerable time is
saved. Application of PLC systems
 PLC can carry out complex functions such as  Manual Control in industry : possibilities of
generation of time delays, counting, human error
comparing, arithmetic operations etc.
o Many production tasks of highly repetitive
 “On Line” (ie. without disturbing the nature & monotonous.
process) as well as ‘Off line’ programming is o Each stage needs careful attention of
possible. operator to ensure good quality of final
 High processing speed and great flexibility in product.
the processing of both analog and digital o close supervision of processes cause high
signals. fatigue on operator
 Suitability for closed loop tasks with several o Loss of track of process control.
loops and high sampling frequencies. o Sometimes it is hazardous as in the case of
potentially explosive chemical processes
Shorter Project Time  PLCs can be used effectively in totally
eliminating the possibilities of human error.
 The hard wired control system can be
 Examples of industries where PLC’s are used
constructed only after the task is fully
for control and automation purpose :
defined. In the PLC, however, the
construction of the controller and wiring are o Tyre industry
independent of control program definition. o Food processing plants
This means that the total hardware is o Bulk material handling system at ports,
standard and desired control is achieved o Ship unloader & Wagon loaders
through program.
o Steel plants & Blast furnace charging
o Brick molding press in refractories,
Easier Storage Archiving and
o Galvanizing plant
Documentation
o Dairy automation
o Pulp factory & Printing industry

4
PLC Programming & Application

Building blocks of PLC system  The input module helps in the following
way:
 It converts the field signal into a standard
 The PLC is basically a programmed interface
control signal for processing by PLC. The
between the field input elements like limit
standard control signal delivered by input
switches, sensors, transducers, push
module could be 5V or 9V whereas the field
buttons etc and the final control elements
signal received by it, could be 24V DC, 230V
like actuators, solenoid valves, dampers,
AC or 115V AC.
drives, LEDs, hooters etc.
 If required, it isolates the field signal from
the CPU.
 This interface called as Programmable Logic
Controller consists of the following:  It sends one input at a time to CPU by
multiplexing action.
o Input Modules  Depending upon the nature of input signal
coming from the field the input module
o CPU with processor and program memory
could be:
o Output modules
 Analog Input Module
o Bus system
 Digital Input Module
o Power supply
 The typical analog current input modules
are 4to± 20mA, 0 to ± 20mA and analog
voltage input modules are 0 to ± 50mV, 0
to± 500mV and 0 to ± 10V.
 The typical digital input modules are 24V
DC, 115V AC and 230V AC.

Central Processing Unit


 The Central Processing Unit or CPU consists
of the following blocks:
 Arithmetic Logic Unit (ALU)
 Program memory
 Process image memory i.e., internal
memory of CPU )
 Internal timers and counters.
 Flags.
 The heart of CPU is its
microprocessor/microcontroller chip.
 The working of CPU is fully controlled by the
Functions of various blocks instructions/ program stored in “user
program memory“.
Input Modules  The user program directs and controls the
CPU’s working.
 The input module acts as an interface  This program is prepared by the user based
between the field control inputs and the on the control logic required for the control
CPU. and automation task.
 The voltage or current signals generated by
the sensors, transducers, limit switches,
push buttons etc are applied to the
terminals of the input module.

5
PLC Programming & Application

Arithmetic Logic Unit (ALU) device is analog then analog output module
is required and if it is digital like contactor
 ALU is the “organizer” of the PLC. coil or a lamp then digital output module is
 The following operations are carried out by required.
ALU.  Typical analog output modules have the
 It organizes the input of external signals and ratings of 4- ± 20mA or 0- ± 10V and the
data. digital output modules have 24V DC, 115V
 It performs logic operation with the data. AC, and 230V AC output.
 It performs calculations.
 It takes account of the value of internal Bus System
timers and counters.
 It takes account of the signal states stored  Bus system is a path for the transmission of
in the flags. signals. In the programmable controllers, it
 It stores the signal states of the input in the is responsible for the signal exchange
“Process Input Image” (internal memory of between processor and input / output
CPU) before each program scanning cycle. modules.
 It stores the result of the logic operation in  The bus comprises of several signal lines i.e.
the “Process Output Image” (internal wires / tracks.
memory of CPU) during the program scan.  There are three buses in a PLC:
 It organizes the output of the result. 1.Address bus which enables the selection of
a memory location or a module.
Output Module 2.Data bus which carries the data from
modules to processor and vice versa.
3.Control bus which transfers control and
 The Output module acts as a link between
timing signals for the synchronization of the
the CPU and the output devices located in
CPU’s activities within the programmable
the field.
controller.
 The field devices could be relays,
contactors, lamps, motorised
potentiometers, actuators, solenoid valves, Power Supply
control valves dampers etc. These devices
actually control the process.  The power supply module generates the
 The output module converts the output voltages required for the electronic modules
signal delivered by CPU into an appropriate of the PLC from the mains supply.
voltage level suitable for the output field  Special Functions Modules
device. The voltage signal provided by CPU  In addition to the above listed modules, the
could be 5V or 9V, but the output module other frequently used modules for special
converts this voltage level into say 24V DC, functions are Interface Modules,
or 115V AC or 230V AC etc. Communication Processor, and Counter
 Thus the output module on receiving signal Modules etc. These can be selected
from the processor switches voltage to the according to process requirement.
respective output terminals. This makes the
actuators (i.e. contactors, relays etc.) or Special function module
indicating lights etc. connected to the
terminal to become ON or OFF.  In addition to the above listed module, the
 Like input module, an output module could other frequently used module for special
be an analog or digital. function interface module, communication,
 The selection is based on the voltage rating counter etc. these can be selected
of the field output devices. If the output according to process requirement.

6
PLC Programming & Application

Working of PLC CPU. This internal memory is called


Process Output Image or PIQ.
1.Bringing Input Signal Status to the Internal
Memory of CPU

 As mentioned earlier, the field signals are


connected to input module. At the output
of input module the field status converted
into the voltage level required by the CPU is
always available.

 At the beginning of each cycle the CPU


brings in all the field input signals from
input module and stores into its internal 4. Sending Process Output Image to Output
memory as process image of input signal. Module
This internal memory of CPU is called as PII,
meaning Process Image Input.

The programmable controller operates


cyclically meaning when complete program
has been scanned; it starts again at the
beginning of the program.

2. Processing of Signal Using Program


Once the field input status is brought into
the internal memory of CPU i e. in PII,
the execution of user program begins,
statement by statement. Based on the At the end of the program run i.e. at the
user program the CPU performs logical end of scanning cycle, the CPU transfers
and arithmetic operations on the data the signal states in the process image
from PII. It also processes times and output to the output module and further
counts as well as flag states. to field controls.

3. Storing the Results of Processing in the


internal memory
The results of the user program scan are
then stored in the internal memory of

7
PLC Programming & Application

Types of PLC Programming  In On-¬line programming the programming


unit is directly connected to the
programming port of the CPU and then the
 The PLC; like computer, is a software driven
instructions are directly written into the
equipment.
user memory of CPU.
 How the PLC should work or say control the
 Initial keying-in of program is normally done
machine or process is decided by the user
in the off ¬line mode (i.e. programming unit
through ‘User Program‘.
is not connected to the programmable
 Depending upon the process control
controller), and after checking and verifying,
requirement the user prepares the
the programming unit is connected to the
program, meaning “write the instructions“.
controller in online mode to test the
These instructions are then stored in the
program. After the commissioning the
“User Memory “or "Program Memory “of
program is transferred to the EPROM
CPU in the form of machine code.
memory module and the controller can now
 The CPU sequentially reads these
operate independent of the programming
instructions and operates the control
unit.
elements taking into consideration the
 The programming unit also provides
input status and the program instructions.
documentation facilities. For print-out of
In this manner the PLC controls the process
the program a printer can be connected to
 The next information that one needs is
the programming unit.
about the Programming Language.
 We can write the User - Program in any of
 For programming, we need a Programming
the following forms:
Unit. There are different types/ models of
programming units available for
o Ladder Diagram (LAD)
programming.
o Statement List (STL)
 The latest trend is to use a general purpose
o Function block diagram (FBD)
PC
o Graphical Method.
as programming unit by loading it with
appropriate software.
 Depending upon the type of PLC and the Circuit Diagram
complexity or otherwise of the process to
be controlled, one should select suitable
Programming Unit/ Software.
 The programming can be done either “On-
line “or “Off-line“.
 Off-line programming means writing of
instructions in the memory of the
programming unit and then simply loading
it into the CPU memory.

8
PLC Programming & Application

Ladder Diagram (LAD)


The “Ladder Diagram “method (LAD) uses
relay logic symbols to formulate the control
task. This arrangement gives the LAD method
the appearance of the schematic circuit
diagram of a hardwired control. This is the
most common method, which is being used
with almost every PLC system

Function block diagram (FBD)


 The Function block diagram method (FBD)
uses digital graphical symbols to formulate
the control task. e.g.
 The symbols used are in accordance with
DIN standard ref: 40 700/DIN.
 (Specific to Siemens STEP 7 Software)

Statement List (STL)  This method is preferred by those users


who are familiar with the logic symbols /
The "Statement List" method (STL) uses logical machine and process sequence.
mnemonic abbreviations in programming. The
statement consists of: Summary
An operation which specifies what is to be
done.  The following example illustrates the three
An operand which specifies where the methods of program representation for the
operation is to be done. It consists of same control logic. (These three methods
Operand Identifier and Parameter. shown in the example are specific to
Siemens STEP 7).
Program Representation in  Basically the individual formats i.e. STL or
FBD or LAD can be converted into each of
Statement List (STL) the other formats using the programmer.
The programmer translates programs
A I 1.0 written in functional block diagram or
A I 1.1 ladder diagram form into a statement list.
However, not all programs written in STL
O
can be translated into FBD or LAD.
A I 1.2
A I 1.3
= Q 4.1

9
PLC Programming & Application


Structure of S7-300 PLC
An S7- 300 programmable controller is made up of the following components:
Power supply (PS)
Central processing unit (CPU)
Signal modules (SM)
Function modules (FM)
Communication processor (CP).

Several S7- 300s can communicate with each other over PROFIBUS bus cables. You require a
programming device to program the S7- 300. You hook the programming device up to the
S7- 300 with a special programming device cable. Figure given above shows a possible
configuration with two S7- 300s.

10
PLC Programming & Application

Components of an S7- 300

11
PLC Programming & Application

Components of S7 - 400

12
PLC Programming & Application

Horizontal and Vertical Arrangement of an S7-300

Location of the CPU


If you choose a horizontal mounting arrangement for your S7- 300, you must locate the CPU
and the power supply at the extreme left of the mounting rail. If you mount it vertically, you
must always locate the CPU and the power supply at the bottom. This improves air flow
through the system to keep electronic components cool.

Permissible Ambient Temperature

13
PLC Programming & Application

Clearances for a Configuration on Several Racks

The Module Arrangement for an S7 Configuration on One Rack


The following rules apply to the arrangement of the modules on one rack

 No more than eight modules (SM, FM, and CP) may be mounted to the right of the CPU.
 The number of modules (SM, FM, and CP) that can be plugged in is limited by the amount
of power they draw from the S7- 300’s backplane.
 The total power drawn from the S7- 300 backplane bus by all the modules on one rack
must not exceed – 1.2 A for the CPUs 313/ 314/ 314 IFM/ 315/ 315- 2 DP – 0.8 A for the
CPU 312 IFM.
 The interface module is always located in slot 3, to the left of the first signal module.

Maximum Configuration for an S7- 300 Mounted on One Rack

14
PLC Programming & Application

Requirement: Interface Modules


If you mount the S7- 300 on several racks, you require interface modules. The task of the
interface modules is to connect the S7- 300 backplane bus from one rack to the next. The
CPU is always in rack 0.

Maximum Configuration

15
PLC Programming & Application

Addressing the S7-300 modules

Module Start Addresses

16
PLC Programming & Application

Addressing Signal Modules


Addressing the Digital Modules
The address of an input or output point consists of a byte part and a bit part.

The byte address depends on the module start address. The bit address is the number
printed on the module.

Addresses of the Analog Modules

The address of an analog input or output channel is always a word address. The channel
address depends on the module start address. If the first analog module is plugged into slot
4, it has the default start address 256. The start address of each further analog module
increases by 16 per slot. An analog input/ output module has the same start addresses for its
input and output channels.

17
PLC Programming & Application

PLC Programming
Task 1: -To establish communication of PLC S7- 300 or S7-400, Make- Siemens, with Simatic
Manager, installed in Programming Unit or PC or Laptop.

1.Make Hardware connection of PC Adapter communication Cable between Port of CPU of


PLC and COM 1 or USB of Programming Unit or PC or Laptop Computer .Keep PLC and PC
in Power OFF condition during this part.

2.Switch ON PC and PLC


3.Keep switch CPU of PLC in RUN-P. (If there is not RUN-P mode switch it in RUN mode)
4.Double Click icon of Simatic Manager;
5.Now you will get this screen.

18
PLC Programming & Application

6. Click Option->PG/PC interface.

19
PLC Programming & Application

7. Select pc adapter MPI and click properties make USB/COM ok

8. Now you will get this screen at the end of this program.

20
PLC Programming & Application

Task 2:- To create new project in Simati c Manager with S7-300 or S7-400
PLC Make- Siemens

1. Double Click icon of Simati c Manager

2. Click file in screen.

21
PLC Programming & Application

3. Click on “new “ ,you will get following screen ,then write project name as ‘ Training’;

4. Click ok

22
PLC Programming & Application

5. Select PLC and upload station to PG.

Click view and ok, file will start taking all information’s regarding PLC Station at the end you
will get following screen

23
PLC Programming & Application

Click Training – Simatic 300 (1) – CPU 314 – S7 program-source-block

Click Insert S7 Block- Organization Block

24
PLC Programming & Application

You will get OB1

Click OK

25
PLC Programming & Application

Click OB1 you will get project ready for writing program in LADDER

Task3:- To perform Hardware configuration of S7-300/400 PLC using Simatic


Manager.

1. Open the Simatic manager Software.


2. Check the communication between PG/PC and PLC.
3. Create new project named as PLC – abcd.
4. Insert a station using insert option from Menu.
5. Open hardware and configure it as per actual hardware.
6. Save, compile & download it.

26
PLC Programming & Application

There are three programming languages in the standard software, STL, FBD, and LAD. You
can switch from one language to the other almost without restriction and choose the most
suitable language for the particular block you are programming.

If you write programs in LAD or FBD, you can always switch over to the STL representation.
If you convert LAD programs into FBD programs and vice versa, program elements that
cannot be represented in the destination language are displayed in STL.

27
PLC Programming & Application

Memory Areas and their Address Ranges


Most addresses in STL refer to memory areas. The following table lists the memory areas
and describes the function of each area.

28
PLC Programming & Application

Memory Areas and their Address Ranges

29
PLC Programming & Application

1.1.
1.2.
1.3.
1.4.
1.5.
1.6.
Accumulators
The two 32-bit accumulators are general The stack mechanism for accumulator
purpose registers that you use to process administration is as follows:
bytes, words, and double words. You can load
constants or values from the memory as  A load instruction always acts on
addresses into the accumulator and perform accumulator 1 and saves the old contents to
logic operations on them. You can also accumulator 2.
transfer the result of an operation from  A transfer instruction does not change the
accumulator 1 to a memory location. Figure5 accumulators
identifies the areas of an accumulator.

Fig 5: - Areas of an Accumulator

Status Word logic instructions. Figure 6 shows the


structure of the status word. The sections that
The status word contains bits that you can follow the figure explain the significance of
reference in the address of bit logic and word bits 0 through 8.

Fig 6: Structure of the Status Word

Bit 0 of the status word is called the first-


check bit (FC bit). The signal state of 0 in the
First Check FC bit indicates that, following this point in
your program, the next logic instruction

30
PLC Programming & Application

begins a new logic string. (The bar over the FC


indicates that it is negated.)

Each logic instruction checks the


signal state of the FC bit as well as the
signal state of the location it
addresses. If the FC bit is 0, the
instruction stores the result of the
signal state check in the result of logic
operation bit of the status word (RLO
bit, see next section) and sets the FC
bit to 1. This process is called a first
check.

31
PLC Programming & Application

Result of Logic Operation Then the instruction combines this result with
the value stored in the RLO bit of the status
Bit 1 of the status word is called the RLO bit word according to the principles of Boolean
(RLO stands for “result of logic operation,” see logic. The result of this logic operation is
Figure 7). This bit stores the result of a bit stored in the RLO bit of the status word,
logic instruction or math comparison. replacing the former value in the RLO bit.
For example, the second instruction in a string Each subsequent instruction in the string
of bit logic instructions checks the signal state performs a logic operation on two values: the
of a contact and produces a result of 1 or 0. result
Produced when the instruction checks the
contact, and the current RLO.

Fig7: Effect of Signal State of FC Bit on Logic Instructions

instruction. It is interpreted during program


Status Bit test (program status) only.
The status bit (STA bit) stores the value of a
bit that is referenced. The status of a bit OR Bit
instruction that has read access to the
memory (A, AN, O, ON, X, XN) is always the The OR bit is needed if you use the O
same as the value of the bit that this instruction to perform a logical AND before
instruction checks (the bit on which it OR operation. An AND function may contain
performs its logic operation). The status of a the following instructions: A, AN A(, AN(, ),
bit instruction that has write access to and NOT. The OR bit shows these instructions
that a previously executed AND function has
The memory (S, R, =) is the same as the value supplied the value 1, thus forestalling the
of the bit to which the instruction writes or, if result of the logical OR operation. Any other
no writing takes place, the same as the value bit-processing command resets the OR bit
of the bit that the instruction references. The
status bit has no significance for bit Overflow Bit
instructions that do not access the memory.
Such instructions set the status bit to 1 The overflow bit (OV bit) indicates a fault. It is
(STA=1). The status bit is not checked by an set by a math instruction or a floating-point
comparison instruction after a fault occurs

32
PLC Programming & Application

(overflow, illegal operation, and illegal integrates this result in a binary logic string.
floating-point number). This bit is set Viewed in this way, the BR bit represents a
according to the result of the next math machine-internal memory bit to which the
instruction or comparison instruction. RLO is saved prior to a word operation that
changes the RLO, so that the RLO will be
Stored Overflow Bit available again after the operation to continue
the interrupted bit string.
The stored overflow bit (OS bit) is set together Bit Logic Instructions
with the OV bit when a fault occurs. Because
the OS bit remains set after the fault has been Boolean bit logic applies to the following
eliminated, it stores the OV bit status and basic instructions:
indicates whether or not a fault occurred in
one of the previously executed instructions.  And (A) and its negated form, And Not (AN)
The following commands reset the OS bit: JOS  Or (O) and its negated form, Or Not (ON)
(jump after stored overflow), the block call  Exclusive Or (X) and its negated form,
commands, and the block end commands. Exclusive Or Not (XN)

Condition Code 1 and Condition These instructions perform the following


basic functions:
Code 0
 The CC 1 and CC 0 bits (condition codes)  They check the signal state of an address to
provide information on the following results establish whether an address is activated
or bits: “1”, or not activated “0”.
 Result of a math operation  They check the signal state of a timer or a
 Result of a comparison counter to establish whether it is set at “0”
 Result of a digital operation (value = 0) or “1” (value > 0).
 Bits that have been shifted out by a shift or  The FC bit determines the result of logic
rotate operation (RLO):
 If FC is 0, the result of the state check will
Binary Result Bit remain unchanged and will be stored in the
RLO (start of a logic string).
The binary result bit (BR bit) forms a link  If FC is 1, the result of the state check will be
between the processing of bits and words. It is combined with the logic instruction (A, O, X)
an efficient means of interpreting the result of according to the truth table and will be
a word operation as a binary result and stored in the RLO.

33
PLC Programming & Application

Truth Table at the Start of a Boolean Logic String


The result of logic operation can be determined with the help of the following truth table:

34
PLC Programming & Application

Truth Table within the Boolean Logic String


After the second Boolean bit operation the RLO can be established with the help of the following
table:

35
PLC Programming & Application

Normally Open Contact


Normally Closed Contact
Figure8 shows a relay logic circuit with
normally open control relay contact between Figure 9 shows the representation of a relay
a power rail and a coil. The normal state of logic circuit with normally closed control relay
this contact is open. If the contact is not contact between a power rail and a coil. The
activated, it remains open. The signal state of normal state of this contact is closed. If the
the open contact is 0 (not activated). If the contact is not activated, it remains closed. The
contact remains open, the power from the signal state of the closed contact is 0 (not
power rail cannot energize the coil at the end activated). If the contact remains closed,
of the circuit. If the contact is activated (signal power from the power rail can cross the
state of the contact is 1), power will flow to contact to energize the coil at the end of the
the coil. circuit. Activating the contact (signal state of
  the contact is 1) opens the contact,
interrupting the flow of power to the coil.

Fig 8: Relay Logic Circuit with Normally Open


Control Relay Contact
Fig 9: Relay Logic Circuit with Normally close
You can use an And (A) or an Or (O) Control Relay Contact
instruction to check the signal state of a
normally open control relay contact. If the You can use an And Not (AN) or an Or Not
normally open contact (I1.1 = 0) is open the (ON) instruction to check the signal state of a

36
PLC Programming & Application

AN, ON, XN
AN : Affects the series connection of a XN : Affects the interconnected series
normally closed contact.. connection of a normally closed
contact and a normally open contact.

ON : Affects the parallel connection of


a normally closed contact.

37
PLC Programming & Application

1.7.
Set and Reset Instructions: S of logic operation from the previous
statement is 1.¬
and R Figure below illustrates how the S instruction
One can Use the Set (S) instruction to set the holds the signal state of its addressed coil Q
signal state of an addressed: bit to 1 and the 4.0 at 1 until the R instruction changes the
Reset (R) instruction to reset the signal state signal state to O. The fact that the signal state
of an addressed bit to 00 The S instruction of the addressed coil remains at 1 until an R
sets the bit that it addresses to 1 if the result instruction resets it to 0 indicates the static
nature of the S instruction.

In the relay logic diagram, if the normally illustrates how the are instruction hold the
open contact at input I 1.0 is activated (its state of its addressed coil Q 4.0 at 0 regardless
signal state becomes 1). The Contact closes. of a change in signal state at the contact that
Power flows across the contact at I 1.0 and triggered the reset I 1.1
across the normally closed contact beneath it,
The fact that the signal state of the
energizing the coil at output Q 4.0 (the signal
addressed coil remains at 0 until S instruction
state of a 4.0 becomes 1). When the coil is
resets it to 1 indicates the' static nature of
energized, the normally open contact at
the R instruction. in the relay logic diagram,
output Q 4.0 across ¬from I 1.0 s closed. After
the coil at output Q 4.0 that was energized
that, regardless whether the contact at input I
by the S Instruction is de-energized (its signal
1.0 is open or closed the coil at output Q 4.0
state becomes 0) by closing the normally
remains energized (at signal state 1) the coil
open contact at input I 1.1. Closing contact I
keeps Itself energized.
1.1 allows power to flow to the coil beneath
The R Instruction resets the bit that it it. his coil opens the normally closed contact
addresses to 0 if the result of logic operation above the coil at Q 4.0, interrupting the flow
from the previous statement is 1 figure of power to the coil. Closing contact I 1.1
triggers the R instruction.

38
PLC Programming & Application

2.1.
Load and Transfer Instructions contents of its addressed source location into
accumulator 1, shifting any information
already contained there to accumulator 2. The
The Load (L) and Transfer (T) instructions
old content of accumulator 2 is overwritten. A
enable you to program an interchange of
T instruction statement copies the contents of
information between input or output
accumulator 1 and writes them into the
modules and memory areas, or between
memory of its addressed destination. Because
memory areas. The CPU executes these
the T instruction only copies the information
instructions in each scan cycle as
that is in accumulator 1, this information is
unconditional instructions, that is, they are
still available to other instructions.
not affected by the result of logic operation
of a statement.
The L and T instructions can handle
information in bytes (8 bits), words (16 bits),
The L and T instructions enable an
interchange of information between the
following modules or memory areas:

 Input and output modules and the following


areas of memory:

o Process-image input and output tables


o Bit memory
o Timers and counters
o Data areas and double words (32 bits).

 Process-image input and output tables and The accumulator has a total of 32 bits. Data
the following areas of memory: with fewer than 32 bits is right justified in the
accumulator. The remaining bits of the
o Bit memory accumulator are padded with zeros.
o Timers and counters
o Data areas You can use the Load (L) or Transfer (T)
instruction to transfer information to or from
 Timers and counters and the following areas accumulator 1 in chunks of the following sizes:
of memory:
 Byte (B, 8 bits)
o Process-image input and output tables  Word (W, 16 bits)
o Bit memory  Double word (D, 32 bits)
o Data areas
A byte is loaded into the low byte of the low
The L and T instructions provide information word of accumulator 1. A word is loaded into
exchange via the accumulator. An L the low word of accumulator 1. Unused bytes
instruction statement writes (loads) the are reset to 0 when loading into the
accumulator.

39
PLC Programming & Application

Integer Math Instructions


Table below lists the statement list instructions that you can use to add, subtract,
Multiply, and divide integers (16 bits) and double integers (32 bits).

The function descriptions in Table point out that the math operations combine the contents of
accumulators 1 and 2. The result is stored in accumulator 1. The old content of accumulator 1 is
shifted to accumulator 2. The contents of accumulator 2 remain unchanged.

40
PLC Programming & Application

Adding Two Integers

Floating-Point Math Instructions


Table below lists the statement list instructions that you can use to add, subtract, multiply, and divide
32-bit IEEE floating-point numbers. Because IEEE 32-bit floating-point numbers belong to the data
type called “REAL”, the mnemonic abbreviation for these instructions is R.

The function descriptions in Table above point out that the math instructions combine the contents
of accumulators 1 and 2. The result is stored in accumulator 1. The old content of accumulator 1 is
Shifted to accumulator 2. The contents of accumulator 2 remain unchanged. The Add
Accumulators 1 and 2 As Real instruction (+R) tells the CPU to add the contents of accumulator 1 and
accumulator 2 and store the result in accumulator 1. This operation overwrites the old contents of
accumulator 1.

The old contents of accumulator 2 remain unchanged. A sample program follows

41
PLC Programming & Application

The same pattern applies to the remaining floating-point math instructions.

Extended Math Instructions


Table below lists the STL instructions which can be used for extended math instructions on floating-
point numbers.

The extended math instructions only work in accumulator 1; the old content of
conjunction with accumulator 1. The value to accumulator 1 is overwritten. The contents of
which the operation is applied is expected in accumulator 2, accumulator 3 and
accumulator 1. The result is stored in accumulator 4 remain unchanged.

42
PLC Programming & Application

Comparison Instructions result of the comparison is a binary digit,


that is, either a 1 or a 0. A 1 indicates that
the result of the comparison is true; a 0
You can use the Compare instructions to
indicates that the result of the comparison
compare the following pairs of numeric
is false. This result is stored in the result of
values:
logic operation bit (RLO bit). You can use
 Two integers (16 bits)
this result in your program for further
 Two double integers (32 bits)
processing.
 Two real numbers (IEEE floating-point, 32
bits).
When the CPU executes a Compare
You load the numeric values into
instruction, it also sets bits in the status
accumulators 1 and 2. A Compare
word. Other statement list instructions can
instruction compares the value in
evaluate the bits of the status word. The
accumulator 2 to the value in accumulator 1
CPU executes Compare instructions without
according to the criteria listed in Table. The
regard to the result of logic operation.

Criteria for Comparisons

43
PLC Programming & Application

4.
Timer Instructions  Load timer in one of the following formats:
o Binary (L)
A timer is a function element of the STEP 7 o Binary coded decimal (LC)
programming language that implements and  Check the signal state of a timer and
monitors timed sequences. The timer
instructions enable your program to perform
the following functions:

 Provide waiting times. For example, after an


injection moulding procedure, the mould
must remain closed for two seconds. Your
program ensures that two seconds elapse
before the part is released from the mould.
 Provide monitoring times. For example, the
program monitors the speed of a motor for
30 seconds after you press the start button. combine the result in a Boolean logic
 Generate pulses. For example, the program operation (A, AN, O, ON, X, XN).
provides pulses that cause a light to flash.
Timers have an area reserved for them in the
 Measure time. For example, the program
memory of your CPU. This memory area
can determine how long it takes for a
reserves one 16-bit word for each timer
container to be filled.
address.
The statement list instruction set supports
256 timers. To find out how many timer words
are available in your CPU, please refer to the
CPU technical data. The following functions
have access to the timer memory area:

 Timer instructions.
 Updating of timer words via clock timing.
These function decrements a given time
value by one unit at the interval designated
by the time base until the time value is
equal to zero.

Bits 0 through 9 of the timer word contain


the time value in binary code. The time
The statement list representation of the STEP value specifies a number of units. Time
7 programming language provides the updating decrements the time value by one
following timer instructions: unit at an interval designated by the time
 Start timer as one of the following types: base. Decrementing continues until the time
o Pulse (SP) value is equal to zero. You can load a time
o Extended pulse (SE) value into the low word of accumulator 1 in
o On-delay (SD) binary, hexadecimal, or binary coded
o Retentive on-delay (SS) decimal (BCD) format. The time range is
o Off-delay (SF) from 0 to 9,990 seconds. You can pre-load a
 Reset timer (R) time value using either of the following
 Enable a timer to start (FR) syntax formats:

44
PLC Programming & Application

45
PLC Programming & Application

 L W#16#wxyz
Because time values are stored with only one
o Where w = the time base (that is, the time time interval, values that are not exact
interval or resolution) multiples of a time interval are truncated.
o Where xyz = the time value in binary coded Values that have too much resolution for the
decimal format desired range are rounded down to achieve
the desired range but not the desired
 L S5T# aH_bbM_ccS_ddMS resolution. Table shows the possible
resolutions and their corresponding ranges.
o Where a = hours, bb = minutes, cc =
seconds, and d = milliseconds When a timer is started, the contents of
o The time base is selected automatically and accumulator 1 are used as the time value. Bits
the value is rounded to the next lower 0 through 11 of accumulator 1 low hold the
number with that time base. time value in binary coded decimal format
(BCD format: each set of four bits contains the
The maximum time value that you can enter binary
is 9,990 seconds, or 2H_46M_30S.
Code for one decimal value). Bits 12 and 13
hold the time base in binary code (see Table).
Time Base

Bits 12 and 13 of the timer word contain the


time base in binary code. The time base
defines the interval at which the time value is
decremented by one unit. The smallest time
base is 10 ms; the largest is 10 s.

Figure17 shows the contents of accumulator 1


low loaded with timer value 127 and a time
base of 1 second.

Fig 17 Contents of Accumulator 1 Low: Timer


Value 127, Time Base 1 Second

Time Base and Its Binary Code

46
PLC Programming & Application

Pulse Timer: SP
 The Pulse Timer is a timer which gives out a pulse output at its binary output and the time
period of the pulse is the time value loaded into the timer.
 Binary output of the pulse timer is set to 1 when signal state at the start input of timer changes
from 0 to 1 and reset input of timer is 0.
 Binary output of the pulse timer is reset to 0 when any one of the three conditions listed below
occurs
o When start input is made 0 before expiry of specified time.
o When reset input is made 1 before expiry of specified time.
o On completion of specified time.
 The following waveforms illustrate the characteristics of the Pulse Timer.

An example of using pulse timer

Extended Pulse Timer: SE

 The Extended Pulse Timer is a timer, which also gives a pulse output at its binary output, and the
time period of the pulse is the time value loaded into the timer.
 Binary output of the extended pulse timer is set to “1” when signal state at the start input of
timer changes from “0” to “1” and reset input of timer is “O”.
 Unlike in the pulse timer once the binary output of the extended pulse timer is set to “1” it will
remain “1” for specified time period even if signal state at the start input of timer is made “0”
after timer starts.
 The binary output of the Extended Pulse Timer is reset to “0” when any one of the two
conditions listed below occurs:
 When reset input is made “1” before the expiry of specified time.
 On completion of specified time.
 If second rising edge appears at the start input of the timer before elapsing of specified time.
The timer will again start for new timing. So the time period of pulse will extend by the time
elapsed.
 The following wave forms illustrate the characteristics of the Extended Pulse Timer.

47
PLC Programming & Application

An example of using extended pulse timer

On-Delay Timer: SD

 The On-delay Timer is a timer in which the binary output is set to “1” after a delay of specified
time. On receiving the rising edge at its start input, the binary output will change from 0 to 1
only after the expiry of programmed time and not immediately when start input is changed from
0 to 1.
 Binary output of the On Delay Timer is reset to “0” when any one of the two conditions listed
below occurs:
 When start input is made “0” before/after expiry of specified time.
 When reset input is made “1” before/after expiry of specified time.
 The following waveforms illustrate the characteristics of the On Delay Timer.

48
PLC Programming & Application

An example of using on delay timer

Retentive On-Delay Timer: SS

 The latching on delay timer is a timer in which the binary output is set to“1”with the delay that
corresponds to the programmed time value i.e., on the expiry of set time when signal state at
the start input of the timer changes from “0“to “1”.
 Binary output of the extended pulse timer is reset to “0” only when reset input of the timer is
made “1” after or before the expiry of time.
 This on delay is different from the one that we get from the On Delay Timer. Here once The
Latching on Delay Timer is started it will remain in operation even if the signal state at the start
input is made “0”.
 If second rising edge appears at the start input of timer before the elapsing of specified time.
The timer will again start for new timing. So the delay time period will get extended to the
extent of elapsed time.
 The following waveforms illustrate the characteristics of the Latching On Delay Timer.

49
PLC Programming & Application

An example of using stored on delay timer

Off-Delay Timer: SF

 The Off-delay Timer is a timer whose binary output does not go to "0" immediately after the
start input is made "0". The time taken for the output to go to "0" when start input is changed
from "On" to "Off" is set in the timer.
 The binary output of the Off Delay Timer is reset to “0“when reset Input of the timer is made
“1”. This happens irrespective of the signal state at the start input of the timer.
 The following waveforms illustrate the characteristics of the Off-delay Timer.

50
PLC Programming & Application

An example of using off delay timer

Counter Instructions
A counter is a function element of the STEP 7 programming language that counts. Counters have an
area reserved for them in the memory of your CPU. This memory area reserves one 16-bit word for
each counter. The statement list instruction set supports 256 counters. To find out how many
counters are available in your CPU, please refer to the CPU technical data. Counter instructions are
the only functions with access to the memory area reserved for the counter. The statement list
representation of the STEP 7 programming language provides the following counter instructions:

 Set (S)
 Reset (R)
 Count up (CU)
 Count down (CD)
 Enable counter (FR)
 Load counter in one of the following formats:
o Binary (L)
o Binary coded decimal (LC)

51
PLC Programming & Application

 Check the signal state of a counter and combine the result in a Boolean logic operation (A, AN,
O, ON, X, XN). A signal state check with an A, O or X instruction will have the result “1”, when the
value of a counter is greater than “0”. A signal state check with an A, O or X instruction will have
the result “0”, when the value of the counter is equal to “0”.

Instructions That Can Use a Counter Word as an Address


An example of using Counter

52
PLC Programming & Application

Word Logic Instructions


Word logic instructions combine pairs of words (16 bits) or double words (32 bits) bit by bit
according to Boolean logic. Each word or double word must be in one of the two accumulators.
For words, the contents of the low word of accumulator 2 are combined with the contents of the
low word of accumulator 1. The result of the combination is stored in the low word of accumulator
1, overwriting the old contents. For double words, the contents of accumulator 2 are combined with
the contents of accumulator 1. The result of the mixture is stored in accumulator 1, overwriting the
old contents.
The following instructions are available for performing word logic operations:

For the instructions that combine 16-bit words, the content of the low word of accumulator 2 is
combined with the contents of the low word of accumulator 1. The result of the logic combination is
stored in the low word of accumulator 1, overwriting the old contents. The contents of the high
word of accumulator 1 and both words of accumulator 2 remain unchanged.

53
PLC Programming & Application

Combining the Contents of the Low Words of Accumulators 2 and 1


Example of an AW Instruction
STL Explanation
L MW10 Load the contents of memory word MW10 into accumulator 1.
L MW20 Load the contents of memory word mW20 into accumulator 1.
The old contents of accumulator 1 are shifted to accumulator 2.
AW The contents of the low word of accumulator 2 are combined bit by bit with the
contents of the low word of accumulator 1 according to the AND truth table. The
result is stored in the low word of accumulator 1.
T MW24 Transfer the contents of accumulator 1 to memory word

Combining Two Words Using the AW Instruction

54
PLC Programming & Application

32-Bit Word Logic Instructions


The And Double Word, Or Double Word, and Exclusive or Double Word instructions (AD, OD, XOD)
combine pairs of words (32 bits) bit by bit according to Boolean logic.

55
PLC Programming & Application

5.
Analog Input Modules
Analog input modules convert analog process signals to digital values that the CPU can process.

Analog Value Representation of Analog Input Modules.


Each analog process signal has to be converted into a digital format, to be stored in the process
image input table (PII). The analog signals are converted into a binary digit that is written in two
bytes each bit position has a fixed value in powers of two. Analog values are represented in two’s
complement.

The following tables show the analog value representations of the different analog inputs in 2-byte
format.

56
PLC Programming & Application

Analog Input Modules


Analog output modules convert the bit patterns that are output by the CPU into analog output
voltages or currents.

Analog Value Conversion: Scaling Values (SCALE): FC105


Reading in and Scaling an Analog Value - FC105
Function FC105 reads in an analog value from an analog input module and outputs a value in the
scale range specified by the user.

57
PLC Programming & Application

The Scaling Values (SCALE) function takes an integer value (IN) and converts it to a real value in
engineering units scaled between a low and a high limit (LO_LIM and HI_LIM). The result is written to
OUT.

Scaling Values (FC105) Parameters

BIPOLAR: The input integer value is assumed to be between -27648 and +27648

UNIPOLAR: The input integer value is assumed to be between 0 and 27648.

Example

Figure in the next page shows how the SCALE instruction works. If the signal state of input I0.0 is 1
(activated), the SCALE function is executed. In this example, the integer value 22 will be converted to
a REAL value scaled between 0.0 and 100.0 and written to OUT. The input value is BIPOLAR as
indicated by the signal state of I2.0.

58
PLC Programming & Application

If the function is executed without error, the signal states of ENO and Q4.0 are set to 1 and RET_VAL
is set equal to W#16#0000.

Fig. Scaling Values (SCALE)

Error Information
If the input integer value is outside the specified range for its type (BIPOLAR or UNIPOLAR), the
output (OUT) is clamped to the nearer of either LO_LIM or HI_LIM and an error is returned. The
signal state of ENO is set to 0 and RET_VAL is set equal to W#16#0008.

Analog Output Modules


Analog output modules convert the bit patterns that are output by the CPU into analog output
voltages or currents.

59
PLC Programming & Application

Unscaling Values (UNSCALE): FC106


Analog values can be output to analog output modules using this function block. In doing so, values
from the range between the lower limit and high limit parameters are converted to the nominal
range of the module in use. The Unscaling Values (UNSCALE) function takes a real input value (IN) in
engineering units scaled between a low and a high limit (LO_LIM and HI_LIM) and converts it to an
integer value. The result is written to OUT.

Unscaling Values (FC106) Parameters


BIPOLAR: The input integer value is assumed to be between -27648 and +27648

UNIPOLAR: The input integer value is assumed to be between 0 and 27648


Example

Figure on the next page shows how the UNSCALE instruction works. If the signal state of input I0.0 is
1 (activated), the UNSCALE function is executed. In this example, the REAL value 50.03978588,

60
PLC Programming & Application

scaled between 0.0 and 100.0 will be converted to an INTEGER value and written to OUT. The input
value is BIPOLAR as indicated by the signal state of I2.0. If the function is executed without error,
the signal states of ENO and Q4.0 are set to 1 and RET_VAL is set equal to W#16#0000.

Fig. Unscaling Values (UNSCALE)

Error Information
If the input real value is outside the LO_LIM and HI_LIM range the output (OUT) is clamped to the
nearer of either the low limit or the high limit of the specified range for its type (BIPOLAR or
UNIPOLAR), and an error is returned. The signal state of ENO is set to 0 and RET_VAL is set equal to
W#16#0008.

61
PLC Programming & Application

2. Element -2
Debug & troubleshoot faults in PLC Systems

Objectives:-

At the end of this element you will be able to


 Explain the method of resetting the CPU memory.
 Explain the process of carrying out maintenance in a PLC by software and
hardware sides.
 List the possible faults & explain the methods the rectify the faults.
 Given a faulty PLC, identify and rectify the faults.
 Carryout maintenance of PLC using hardware and software methods.

60
PLC Programming & Application

CPU Memory Reset


You must reset the CPU memory
 before you transfer a new ( complete) user program to the CPU
 If the CPU requests a MRES with its STOP LED flashing at 1- second intervals. Possible reasons for
this request are listed in Table

Resetting the CPU Memory Using the Mode Selector


To reset the CPU memory using the mode selector, do the following (also see Figure):
1. Turn the key to the STOP position.
2. Turn the key to the MRES position and hold it in this position (for about 3 seconds) until the
STOP LED lights up again.
3. The CPU acknowledges the reset request.
4. Within 3 seconds, you must turn the key back to the MRES position and hold it in this position
until the STOP- LED flashes (at 2 Hz). When the CPU has completed the reset, the STOP LED stops
flashing and remains lit.

The CPU has performed the reset.


Fig 2:- Resetting the CPU Memory Using the Mode Selector

61
PLC Programming & Application

What Happens on the CPU?

The Mode Selector and LEDs


The mode selector and the LEDs are identical for all CPUs. Their purpose and functions are also
identical. There are differences in the position of the mode selectors and the LEDs and in the number
of elements.

62
PLC Programming & Application

Positions of the Mode Selector

Status and Fault LEDs


The CPUs have the following status and fault LEDs:

63
PLC Programming & Application

Meaning of the Status and Fault LEDs

64
PLC Programming & Application

List of Various Make PLC with Their Accessories


S. PLC model Company Master Communication Communication
No software cable driver

1. S7-400 CPU 412 Siemens Simatic PC Adapter Options/PG/PC


manager Interface
v 5.3,5.4,5.5
2. S7-300 CPU 314 Siemens Simatic PC Adapter Options/PG/PC
manager Interface
v 5.3,5.4,5.5
3. S7-200 CPU 224 Siemens Microwin 32 PC/PPI cable Options/PG/PC
Interface
4. S5 CPU- Siemens Step-5 TTY cable+9volt
100U/135U adapter Option F4 KEY

5. SR-103 Schneider Zelio RS 232 CABLE

6 SLC 5/03/04 Allen Bradley RS Logix 500 1.RS232 (1747- RSLinx


CP3)
2.PIC-1747
7 Control logix Allen Bradley RS Logix 5000 RS 232 CABLE RSLinx

8 SR3 B261 FU Telemechanique Zelio soft SR2 CBL01


9 Modico Telemechanique PLC Junior RS 232 CABLE
TSX-MICRO
10 Control logic Allen Bradley RS Logix 5000 RS 232 CABLE
5555
11 MELSE Mitsubishi Fx-CPWin SC-90
FX-series
12 Nexgen 5000 messung codesys Nexgen 5000
13 Nexgen 4000 Messung Doxmini RS-232
14 Micro Mini Messung Doxmini RS-232
15 Versamax GE Fanuc Cimplicity RS-232 Option Target-
Go online

65
PLC Programming & Application

Maintenance Tips for Engineers


Maintenance Tips
1. Always keep the Master Software and communication. Cable as per list of accessories.

2. Take the backup of Machine software is user program using master software and keeps its
multiple. Copies at more than 3 place in form of floppy, CD, Hard disc etc.

3. Keep the electrical wiring diagram of all I/O's between PLC Cards and devices i.e. switches,
Motor, Transducer etc via all junction boxes.

4. Make list of all Input and Outputs coming over PLC Cards by seeing their LED Status, When
Machine is ready to start but not running. Paste its one copy over panel where PLC is mounted
and store its one copy in your record.

5. Make same list, when Machine is running, and also keeps at 2places described in earlier step.

6. Always keep at least one set of following cards in spare, CPU Card- 1 no,
Digital Input Card – 1 no. Analog Input Card - 1 no.
Digital Output Card –1 no. Analog output card - 1 no.

7. Must know process of UPLOADING and DOWNLOADING OF User Program, using Master
Software.

8. Must know how to make ONLINE your User program with PLC using Master software as it helps
in identifying faults & troubleshooting.

66
PLC Programming & Application

Conclusion

From the previous chapters we see that new generation PLC like Siemens S 7 Series as well as
equivalent models from' other manufacturers can not only handle and- process conventional. Digital
input and output signals but they can also .work with analog Signals New generation PLC's can be
termed as Programmable Controllers (PC) instead of PLC. These Programmable controllers can
perform any logical, sequential and arithmetic operation adroitly. Special functions like PID
controllers, High Speed counter, Interrupt processing etc. makes it useful for all type of automation
application in Manufacturing and Process plants.

Interfacing of PLC with various MMI software. Further enhances the plant operation, Visualization,
Alarming, trending, data logging etc. This has led to elimination of number of hardware operating
stations. Full plant operation can now be done by single operator console.

Profibus, Device Net, CAN-BUS etc. are communication protocols, which these, new generations PLC
supports. Through these networking PLC can communicate with each other as well as other plant
automation devices like Drives, Process Controllers, DCS System etc. Nowadays most of the plant
automation devices support Open System Architecture, which reduces the dependability of user on
one vendor. PLC from one manufacturer can communicate with Inputs/output from different make
and so on. Industrial Ethernet and SCADA Systems help in automation of multi-location plants and
utilities.

67
PLC Programming & Application

References

 Primer: S7-300 programmable controller quick Start

 Manual: S7-300 Programmable Controller, Hardware and Installation

 Reference Manual: S7-300, M7-300 Programmable Controllers Module Specifications

 Instruction List: S7-300 Programmable Controller

 User Manual: Standard software for S7 and M7, STEP 7

 Manual: Ladder Logic (LAD) for S7-300 and 57-400 Programming

 Programming Manual: System Software for S7-300 and S7-400 Program Design

 Reference Manual: System Software for 57-300 and S7-400 System and Standard
Functions

 Manual: FSD for S7-300 and 400, Programming.

 Master Index, STEP 7

 Manual: Structured Control Language (SCL) for S7-300 & S7-400 Programming.

 Manual: GRAPH for S7-300 and S7-400,

 Programming Sequential Control Systems

 Manual: Graph for S7-300 and S7-400,

 Configuring Process Diagnostics for LAD, STL, and FBD

 Reference Manual: Standard Software for S7-300 and S7-400

 STEP 7 Standard Functions, Part 2

68
PLC Programming & Application

Glossary & Abbreviations

PLC
Programmable Logic controller
The PLC is basically a programmed interface between the field input elements and the final control elements

CPU
Central processing unit
A central processing unit (CPU) is the hardware within a computer that carries out the instructions of
a computer program by performing the basic arithmetical, logical, and input/output operations of the
system

Relays
A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a
switch, but other operating principles are also used, such as solid-state relays

Contactors
A contactor is an electrically controlled switch used for switching a power circuit, similar to a  relay except
with higher current ratings. A contactor is controlled by a circuit which has a much lower power level than
the switched circuit.

Solenoid valve
A solenoid valve is an electromechanically operated valve. The valve is controlled by an electric
current through a solenoid.

Dampers
A damper is a valve or plate that stops or regulates the flow of air inside a duct 

Profibus
Process Field Bus, which can be used for communication between two PLC or communication between PLC
to Remote I/O’s.

LED’s
Light emitting diode

STEP
Siemens Technical education Program

Transducer
A transducer is a device that converts a signal in one form of energy to another form of energy.
Energy types include (but are not limited
to) electrical, mechanical, electromagnetic (including light), chemical, acoustic and thermal energy.

PG/PC
Programming unit/ Personal computer, which is used for program implementation.

69
PLC Programming & Application

Test your knowledge


1. Master Software for the programming of S7-300/400 PLC is-
A. S5 C. RS Logix
B. Simatic Manager D. Nexgen-5000
2. Interfacing Module Is Use For-
A. Interconnection Between two CPU C. Digital Inputs & Outputs
B. Interconnection Between two Racks D. Its Dependent on Condition

3. PROFIBUS Cable Is Used For-


Interconnects The Individual tier of S7-
A. C. For wiring of digital modules
300
B. Interconnects between two PLC D. Program Downloading only
4. The period of time taken by CPU to completely evaluate the logic of a PLC is called what?
A. Execution time C. Scan time
B. Ladder time D. Interrupt time

5. Programming Cable for the S7-300 PLC is


A. PC-PPI Cable C. RS232 Cable
B. PC-Adapter Cable D. None of above
6. Analog signal in S7-300 is
A. 16 Bit C. 12 Bit
B. 32Bit D. 64 Bit
7. Download means-
A. Transferring program from PC to PLC C. Depends on Application
B. Transferring program from PLC to PC D. None of above.
8. Result of Arithmetic operation is stored by CPU in
A. Data word C. Accumulator word
B. Memory word D. Status word
9. One of the following is an output element
A. LED’s C. Limit switch
B. Transducer D. Optical sensor
PLCs are _____________ designed for use in the control of a wide variety of manufacturing
10.
machines and systems.
A. Special-purpose industrial computers C. Electromechanical systems
B. Personal computers D. All of the above

70
PLC Programming & Application

Notes
....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

71
PLC Programming & Application

Notes
....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

.....................................................................................................................................................................

...................................................................................................................................................................

...................................................................................................................................................................

....................................................................................................................................................................

...................................................................................................................................................................

Answers to test questions :


1: B, 2: B, 3: B, 4: C, 5: B,
6: A, 7: A, 8: C, 9: A, 10: A,

72
PLC Programming & Application

Overseas Centre - Ethiopia


Addis Ababa Branch; Unit – B, 3rd Floor, H.No.002,
Wareda 02, Bole Road, Bole Sub City, Addis Ababa, Ethiopia
Phone :+251 116627272 e-mail: [email protected]
website : www.crispethiopia.com

You might also like