PLC Programming & Application 24-05-18
PLC Programming & Application 24-05-18
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.
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.
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.
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.
This learning package provides planned learning experiences to help you acquire the
competency designed in the training programme.
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.
ii
PLC Programming & Application
Competency Statement
3
PLC Programming & Application
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:-
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:
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
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.
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
7
PLC Programming & Application
8
PLC Programming & Application
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
11
PLC Programming & Application
Components of S7 - 400
12
PLC Programming & Application
13
PLC Programming & Application
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.
14
PLC Programming & Application
Maximum Configuration
15
PLC Programming & Application
16
PLC Programming & Application
The byte address depends on the module start address. The bit address is the number
printed on the module.
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.
18
PLC Programming & Application
19
PLC Programming & Application
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
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
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
24
PLC Programming & Application
Click OK
25
PLC Programming & Application
Click OB1 you will get project ready for writing program in LADDER
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
28
PLC Programming & Application
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.
30
PLC Programming & Application
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.
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)
33
PLC Programming & Application
34
PLC Programming & Application
35
PLC Programming & Application
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.
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:
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
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
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.
41
PLC Programming & Application
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
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:
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.
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
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.
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
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
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
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
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”.
52
PLC Programming & Application
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
54
PLC Programming & Application
55
PLC Programming & Application
5.
Analog Input Modules
Analog input modules convert analog process signals to digital values that the CPU can process.
The following tables show the analog value representations of the different analog inputs in 2-byte
format.
56
PLC Programming & Application
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.
BIPOLAR: The input integer value is assumed to be between -27648 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.
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.
59
PLC Programming & Application
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.
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:-
60
PLC Programming & Application
61
PLC Programming & Application
62
PLC Programming & Application
63
PLC Programming & Application
64
PLC Programming & Application
65
PLC Programming & Application
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
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: Structured Control Language (SCL) for S7-300 & S7-400 Programming.
68
PLC Programming & Application
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
70
PLC Programming & Application
Notes
....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
71
PLC Programming & Application
Notes
....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
.....................................................................................................................................................................
...................................................................................................................................................................
...................................................................................................................................................................
....................................................................................................................................................................
...................................................................................................................................................................
72
PLC Programming & Application