Automation and PLC Lab-2-58
Automation and PLC Lab-2-58
Theory: In the previous experiment the hardware and software associated with Distributed
Control System is discussed. In this experiment the software and programming concept
is discussed.
Generally in DCS Functional Block Diagram (FBD) is used for programming and Sequential
This language basically is a graphical language wherein the users are allowed to program
elements in the form of blocks. The blocks then can be wired together like electrical circuits. It
It is a graphical method of programming DCS. Functional algorithms and control strategies for a
particular plant can be implemented by FBD. The control modules are treated as unique entity in
DCS system. Each function block contains specific algorithm such as AI, AO, DI, DO, PID and
the parameters required for the algorithm. Function blocks ranges from simple input conversion
2. Math
3. Logical
4. Timer/ Counter
5. Analog Control
6. Advanced control
Definition name: This is the name by which the block is identified in the library.
Usage name: This name can be user defined as per his/her convention.
Parameters: These are part of the function block available for standard connection.
Analog Input
Analog Output
Discrete Input
Discrete Output
Pulse Input
2. Math Library
Add
Comparator
Divide
Multiply
Subtract
Absolute value
Integrator
3. Logical Library
And
Or
Condition
Not
Multiplexer
De multiplexer
On Delay Timer
Retentive Timer
Timed Pulse
Input Selector
Limit
PID
Ratio
Ramp
Filter
Scalar
Signal Characterizer
Signal Generator
Signal Selector
Splitter
Let us discuss about the commonly used Input/ Output library function blocks.
Analog Input (AI) Function Block accesses a single Analog measurement value and its
status on the AI channel. In manual mode, when AI block is configured, input has to be in
automatic mode, output of the block will reflect process variable value. Input to the block
could be 4-20mA or digitally communicated variable from HART based transmitter.
Analog output (AO) function block assigns any output value to a field devices like control
valve through a specific AO channel. In manual mode, the output parameter value can be
set manually. In automatic mode, OUT is set automatically based on set point and process
variable value in engineering units. A feedback can also be set for the output parameter.
The Discrete Input (DI) Function blocks accesses a single digital input value with its status
between two states of the field devices. The block gives processed physical input for other
function blocks. In automatic mode, Process variable is copied to output which can be
either 0 or 1. In manual mode, the digital input can be toggled manually and output follows
the same.
Digital Output block takes value from the process and writes it to specific digital output
channel. One can confirm physical output operation by configuring a hardware discrete
input to it. In automatic mode, when the signal from process changes the output of the
block which will be connected to AO channel which in turn connects to field outputs e.g a
Logical Library:
Commonly used logical blocks under logical library are described here
AND Function Block:
AND function block is used as an AND operator. For 2 input AND gate if both the inputs
OR Function Block:
OR function block is used as an OR operator. For 2 input OR gate if any one inputs is high,
the output of the functions block is high. The function block and the truth table is as given
below:
NOT Function Block:
NOT function block is used as NOT operator, wherein if the input to the block is high or
active the output is opposite i.e. low and vice versa. The function block and the truth table
Procedure:
Click on the link provided under simulator tab to open the simulator. You need to configure the
required logic.
Step 1: First left click on AI block available under IO tab. Drag this block to required position
3. Take the cursor to the color dot at the output side of AI block. Move it by left clicking and take
5. When user clicks on Run tab, default value of AI will get displayed on wired connection.
To change the input value and observe the output change, right click on the AI block. Select edit
and enter an input value in the range 0-100. You will observe the change at the AO block output.
When you click on the block, the properties of the block gets displayed at left hand bottom corner.
To delete the connection, click on the wire question mark at the output side of the block and press
delete key.
Other options like delete, disable and configure are available on right clicking the block. For
modifying the logic, user need to first press Stop tab and enter into Configure tab.
Follow same procedure as above to get the blocks in the workspace and connect DI and DO blocks.
In RUN mode, change the digital input value to 0 from1 or vice-versa and observe the effect.
To configure the logic circuit, first reload the page by clicking Clear tab
1. First left click on digital input (DI) block to get it in the workspace. Repeat this
procedure for getting 2 DI blocks. They will be by default DI1 and DI2. Similarly get 1
2. Left click on any logic function block e.g. AND function from Logic Tab available in
Initially only one input connection is available with the logic block. As you make DI
connection with this input, another connection appears for this logic block.
Connect DI2 output to this second AND block input. Connect output of AND block to
input of DO.
4. Now click on Compile tab. If any compilation errors are there, it will be shown.
5. Now change one of the inputs to AND gate by toggling DI value from 0 to 1. Observe
the DO status.
6. Change another input to AND gate in the similar manner and observe DO status.
Similarly verify the truth tables for OR and NOT Logic Gates.
Link:
http://ial-coep.vlabs.ac.in/Expt2/AnalogDigital.html
Experiment No. 2
The controller used in DCS has an inbuilt clock for its functioning. This clock is used for
executing the instruction cycle or scan cycle or in case any of important actions.
There are two types of delay required or available in the entire operation
• Logical delay
• Process delay
This internal clock is used as a reference when it is necessary to have a logical delay in the
program. Depending on number of cycles of the clock the calculation of the delay is calculated.
The base time of the delay can vary for different manufacturers e.g. 1ms, 10ms or 1s. It is based
on the crystal oscillator present in the controller whose time is taken as the reference for the
calculation.
Concept of Counter
In timer, the internal clock of the controller is considered for calculation of the delay, the same
clock can be used to calculate the external pulses of the physical world.
Suppose there is an application wherein we need to count the number of balls entering the vessel.
A limit switch as a sensor can sense the ball as it comes to the vessel. The high to low transition
at the sensor output can be counted by taking the reference of the internal clock pulse of the
controller.
TYPES OF TIMERS
Three types of timers available in DCS are on delay, Off delay and Retentive timer.
1. On Delay Timer (OND): On delay timers are preferred in most of the applications.
The example to demonstrate the function and operation of a timer is a firecracker. The firecracker
when it is lighted it takes some time to burst because of the lead present which we light. Thus after
burning the lead, which is the delay the cracker burst. Now in terms of On Delay Timer when a
high/true/active signal is given at the input, time duration specified, the output of the timer block
The function block and timing diagram for On Delay Timer is shown below:
2. Off Delay Timer (OFFD): In Off Delay Timer, the output remains high until a high to
low pulse is applied at the input terminal. The output goes low after the time duration
specified has elapsed if a high to low transition is applied at input. The functional block
3. Retentive Timer (RET): In the above timers if the input signal changes its value back
to original, before the specified time duration is elapsed, the timer resets. It does not retain
its value. In order to overcome this problem retentive timer is used. As the name suggests,
it retains the value even if the input signal changes back to original state before time
duration has elapsed. These type of timers are used in real time clocks where retention of
time value is important. The block diagram and timing diagram of the same is shown
below:
TYPES OF COUNTERS
counting from 0 to the value specified as preset value. When the preset value and no of
2. Down Counter: Down Counter counts input pulses in decrement manner i.e. it starts
counting from the value specified in preset to 0 values. This can be done when input goes
from high to low or low to high as we select in the function block. When the preset
Note: The up and down counter function can be implemented in same counter block. We
need to select the type as up or down counting.The input signal form in which counting is
to be done i.e. from low to high or from high to low is also selectable.
Part 1: Understanding the operation of On Delay Timer and Off Delay Timer
1. From the panel at left side, click on IO tab and click on DI.
2. Use left click and drag the DI block at center location in the workspace.
3. Take TON block available under TIMERS tab by clicking on it. Put this block next to
DI block.
4. Next to TON block, take DO block to observe On delay timer operation. Follow the
of DO block.
6. Rightt click on Timer block and configure it. Enter required delay (preset value by which
the output is to be delayed) in terms of milli seconds. e.g. For a delay of 1 second, require
7. When configuration is done, click on Compile tab to activate the Run tab. Run the logic
now.
8. To start the Timer operation, Change the DI value. You need to toggle the input value
9. Observe the accumulated timer value. When it becomes equal to preset value, the timer
10. Change the DI value to 0 again and observe the output status.
11. To observe the operation of off delay timer, first click on Stop tab. Go to compile mode.
You need to replace the TON block with TOFF Timer block.
12. Right click on TON block. Select and delete the block. Form panel, select TOFF block
The output of Off delay timer is set to 1 without any delay, when DI is set to 1. But when
DI is changed back to 0, the timer operation starts, delay is provided and the output is
Link:
http://ial-coep.vlabs.ac.in/Expt3/TimersCounters.html
Experiment No. 3
Theory: Previous three experiments cover the basic hardware and software information along
with the functions block available in DCS. This information can be applied for logic
development in specific application. Traffic light control is one common example where
There are two lamp posts as shown in the diagram. Consider a case where the lamp R1
is off.As the lamp R1 is off,lamp G2 will be on to allow the traffic from south to north.
The lamp on-off sequence is as follows.
For implementing this logic using function blocks, on delay times can be used.
Solution Hint:
For starting the Traffic Control System in auto mode use Pulse Input Block.
Procedure:
One of the possible solutions implemented using EMERSON DELTA V DCS is shown
below. Refer to the procedure in experiments 3 related to timer and counter function
implementation. Configure the logic as shown below and see the result. You can also try
Instead of PIN block used in the solution, make use of DI block available in simulator.
The lamp G2 is on when system is started. When 25 sec time is elapsed (indicated by OND
OND block is used to switch on lamp R2 and switch off lamp Y2 after a delay of 5 sec.
The lamp R2 is kept on for 30 sec and after this delay the cycle is repeated.
Another OND block with logical AND block is used to implement this. To get negated
output status NOT block is used. This is the logic for one lamp post. In the similar manner
Link:
http://ial-coep.vlabs.ac.in/Expt4/TrafficControl.html
Experiment No. 4
Theory: At this stage we are aware of various function blocks available in the dcs library. In the
traffic control application we have seen how on delay timers (OND block) are used.
Let us see another example for logic development. The P & I diagram for bottle filling
To start the process, command is given by the field operator as well as from the control room i.e.
through DCS. The Conveyor belt starts running when conveyor motor (CM) is switched on. The
bottles are kept manually on the conveyor belt. When bottle is reached below the filling solenoid
The filling process starts by opening SV, when the bottle is raised up by raising the platform by
Upto 90% filling takes place through solenoid valve (coarse) and remaining 10% (100% full
Bottle 90% full condition is sensed by proximity switch (coarse). Bottle 100% full condition is
sensed by another proximity switch (fine). When bottle is full SV should become off and the count
is displayed. When SV is closed, CM runs again till next bottle is detected by BP switch and the
cycle repeats.
Procedure: One of the possible solutions implemented using EMERSON DELTA V DCS is
presented here. Try to analyse this logic and implement it using simulator.
Link: http://ial-coep.vlabs.ac.in/Expt5/BottleFilling.html
Experiment No. 5
Theory: Distributed control systems are used for controlling plants which are physically as well
as functionally distributed. This control system is preferred when number of analog control loops
to be controlled is more than discrete control. One of the analog schemes used as basic control
strategy is PID control. The theory behind PID control is discussed here.
• Proportional
• Integral
• Derivative
Proportional mode: - In this mode the controller output varies linearly with respect to the error.
m = Kp * e + Po
Where,
e is the error in %
Due to addition of proportional bias, positive as well as negative errors are handled. Generally Po
is set at 50% to handle equal positive and negative error range. Higher is the gain lower is the band
to control.
Integral mode: - Integral mode is used to remove the offset produced due to P mode. Offset can
Where,
When this action is used alone due to integral effect the action becomes too slow. When
combined with Proportional, the action may go into saturation which is called as Reset Windup.
To overcome this, controller output is limited at lower and higher end. This is called as Anti reset
Derivative mode:-This action is used to increase the speed of response of slow processes. It
anticipates the rate of change of error and takes the control action.
Set Point can be achieved quickly by using D mode. In noisy environment. this action is not used
condition. Even for constant error D action provides no correction, hence not preferred alone. It
Composite controller, i.e. P, I and D adds advantages of all the three modes.
Loop tuning time can be optimized by using proper combination of PB, Ti and Td
One of the analog control functions available in DCS is ‘PID’. Let us look at various configurable
The process parameter analog value (PV) is given as input to the block at IN terminal. The remote
analog set point is provided to CAS IN terminal in case of Cascade Control. In case of
feedforward control input is given to FF terminal. In case of manual mode, input value is given
to SIMULATE terminal. For auto/manual bumpless transfer or to avoid rest windup, the FB OUT
is connected back to FB IN of the same or another block. This keeps the track of changes made
in manual mode and adjusts the controller output prior to the control mode is changed from
manual to auto.
Let us see how PID function is used for controlling heat exchanger.
The piping and Instrument diagram for the heat exchanger with a boiler unit along with system
This pipe in pipe type heat exchanger uses the steam produced by an electrically fired boiler which
raises water temperature. The feed water pump for boiler is mounted on the base frame of the unit
and pumps water into the boiler. To avoid scale formation and to reduce maintenance treated water
is used. Heat released by operating heaters is utilized for heating water in the shell. Insulation of
shell is done with glass wool to prevent heat losses. The steam pressure is controlled by means of
a pressure switch at 4.5 Kg/cm2. PT-100 sensors used monitor the temperature at the inlet and
outlet . The inlet water flow is measured with a magnetic flow, while the steam pressure is
monitored using HART (Highway Addressable Remote Transducer) based pressure transmitter.
The objective is to maintain water outlet temperature. The variables associated are
Digitization is a process where continuous analog signal is converted into a finite number
of discrete states. These states are well separated so that noise does not create errors.
Some information is essentially digital. Hence it is natural to process and manipulate such
information using purely digital techniques. Examples are numbers and words. The
drawback to digitization is that a single analog signal (e.g. a voltage which is a function of
time, like a stereo signal) needs many discrete states, or bits, in order to give a satisfactory
reproduction.
Logic
The simplest task we can think of is a combinational type of logic decision. For example,
we can design a digital electronic circuit to make an instant decision based on some
information. Here we emphasize “instant” in the decision making process. That means,
Truth Tables:
Boolean algebra:
Basic Laws:
Theory:
Introduction
Each manufacturer of PLC systems has own style of writing the instructions. Different PLCs has
different instruction sets but even some common basic instructions are shared by all the PLCs. All
manufacturers give different software packages for programming PLCs. Ladder is most commonly
used programming language. Prior to PLCs, relay logic was used in industry. Ladders were
When the switch is on, current will flow through the coil on iron piece. This iron core acts an
electromagnet and due to the magnetic field upper contact gets attracted towards lower one and
Ladder Programming
Ladder diagram is popular language of programming the PLCs. Ladder diagram shows the
there are two vertical lines generally called as Phase (positive) or neutral. Rungs which
show current flow in horizontal direction are the sequence in which the logic executes. The
Analogous to relay, ladder has two main symbols which are contacts and output coil.
Generally each rung has inputs (contacts) on left hand side and outputs (coil) on the right
hand side. These contacts and coils are called as bits of the relays. Each input and output
are individual bit in I/O files. An instruction in ladder instructs PLCs how to respond to the
bits in I/O files which are stored in the memory. Input contacts are the condition area, the
table below.
Link: http://plc-coep.vlabs.ac.in/exp2/simulator2.html
Please follow the steps so as to understand the procedure for developing ladder logic for
understood:
a. Understand the problem statement like test the logic for OR gate, AND Gate etc.
b. Develop the logic on paper and validate the logic by considering various cases
c. Prepare the truth table and test the logic using all valid cases
2. The procedure for writing the ladder diagram in the work space is as follows
a. The screen shot for the first window will appear like this.
Add a new rung by clicking on the 'Add Rung' icon. The window will appear like this:
b. Place the contacts as per the requirement by left clicking the appropriate contact shown at
the top side. In the example demonstrated below one normally contact and one coil is placed as
C. Right click on the contact or coil and you can give tag name like “start”, “stop” etc. Please
ensure that the tag numbers are true replica of process connections. Similarly give tag name to
coil like “motor”, “Lamp” etc. The final ladder will look like this.
d. Please note that the tag names are case sensitive and if you are using them in circuit as bit
e. Click the Compile button so the ladder will be ready for running. For testing the logic you
need to click on Run. Both sides of the rung will become green and this is the indication of run
mode. Please not that in run mode you can't make changes in the ladder. For modifications user
f. By right clicking on the contact toggle the state of contact. Check the output contact status.
g. Please remember the ladder contacts or the state of the inputs and outputs are always in de-
energised state. The de-energised is that state wherein the contacts are in non-active state.
h. You can once again toggle the contact and the output state will change. To add any contact
you will have to go to development mode. Click on the rung and add contacts.
i. To delete any contact or output right click on the contact and press “delete”, the contact will
be deleted.
k. To add element in parallel click on the node near contact where you wish to add parallel
branch. Select the branch and click on the '+' sign to complete the loop. The screen will appear
as shown below.
l. Repeat the procedure and verify your logic.
m. Similarly you can check the logic for OR, NOR, and NAND gates. Validate the truth tables
Theory: One method of starting electric motors is using direct on line (DOL) or across the
line starter. In this method full line voltage is applied to the motor terminals. This is
simplest type of motor starter. An electrical wiring diagram for single phase DOL starter
is shown below.
A DOL motor starter contains fuse and over load relay (OLR) for protection purpose. The
starter can be contain momentary contact or maintained contact push buttons. The example
considered here is momentary contact push buttons. For starting purpose normally open
(NO) push button is preferred whereas normally closed (NC) push button is used to stop
the motor.
The excessive supply voltage drop causing high inrush current is the criteria to limit the
use of DOL starter. Conveyor motors, water pumps are the applications where DOL starters
are used.
Procedure
Problem Statement: To start a motor using DOL starter. The simple P&I; diagram for this
problem is as below.
Sequence of Events :
1. When Start push button (PB1) is pressed, Motor (M1) has to start.
2. If Start pushbutton (PB1) is released and Stop pushbutton (PB2) is not pressed,
2. When Stop push button (PB2 is pressed, Motor (M1) has tol stop.
3. If stop push button is released and start is not pressed (released) motor shouldl
remain off.
As the momentary contact push buttons are used here, the condition of PB1 is maintained
The same sequence of event can be executed by using latch and unlatch instruction in the following
way.
Procedure:
1. The Latch and unlatch instructions are used for holding the output status.
2. The tag name of latch and unlatch output bit must be same.
3. Once you toggle the input bit for the latch; even if you release it by toggling once
4. To unlatch the output you will have to toggle the input bit in the unlatch rung and
Execute the following ladder on simulator and observe the output status:
You can develop ladder for a DOL “Direct On Line” starter using these instructions.
You can also develop the logic using start and stop push buttons as explained under theory tab.
Link: http://plc-coep.vlabs.ac.in/exp3/simulator3.html
Experiment No. 8
Theory: LC timers instruction is used to activate or deactivate a device after a preset interval
of time.
Consider an example wherein a certain step in the manufacturing process is to begin 30 seconds
after a signal is received from a limit switch. The 30 seconds delay is the ON-delay timer’s
preset value.
The instruction mainly includes three status bits namely EN, TT, DN. Their significance is as
follows:
Enable (EN) Bit: - The enable bit indicates the TON instruction is enabled
Timer-Timing (TT) Bit: -The timing bit indicates that a timing operation is in process.
Done (DN) Bit: -The done bit changes state whenever the accumulated value reaches the preset
value.
Accumulator (ACC) Bit: -The accumulated value specifies the number of milliseconds that
Preset (PRE) Bit: - The preset value specifies the value (1msec units) which the accumulated
value must reach before the instruction sets the .DN bit.
The figure shows the timing diagram which illustrates the functioning of all the bits in sequence.
The following example, after running, will illustrate the function of each bit
Before toggling the Start, all the lamps namely Lamp_1, Lamp_2 and Lamp_3 are OFF.
After the Start is toggled, Lamp_1 and Lamp_2 are ON. This implies the Timer_1 is enabled and
its timer timing bit is activated. After the delay i.e. preset value of the timer, Lamp_1 and Lamp_3
Procedure:
In this experiment the on delay timer will be tested for its functionalities using Simulator.
While configuring the timer thedefault time is 1 mS. Select appropriate preset value as per the
need of the application. The screen shot of the configured timer will appear like this.
To test the EN, DN, and TT bits;configure the timer by right clicking anywhere on the timer
Add new rung to test the timer status or to energies the output. You can also test the
cascading of the timer using these bits. Observe the tag name for timer DN bit. See
following screen shot to observe the output bit status when delay is over.
Observe the bit status in Run mode when input a is toggled again.
Link: http://plc-coep.vlabs.ac.in/exp4/simulator4.html
Experiment No. 9
Theory: The timer concept and details of on delay timers with its terminology is discussed in
OFF-Delay Timer:
Consider an example where the contents of a storage tank are to transfer to further process.
When the low level is detected by level switch the outlet valve is to be closed. To allow entire
contents to drain out, sometime delay is needed as the level switch is installed slightly above
the tank bottom level. This can be achieved by using off delay timer.
Consider an example that, there is a Low level switch to a tank, and we have to close the drain
valve of the tank after 5 second delay when low level is reached. In this case this 5 seconds
delay can be given using off delay timer as we have to close the drain valve after delay.
The figure below shows a symbolic representation of the off delay timer.
The instruction mainly includes three status bits namely EN, TT, DN. Their significance is as
follows:
EN-Enable Bit: - The enable bit indicates the TOF instruction is enabled.
TT-Timer-Timing Bit: - The timing bit indicates the timing operation is in process.
DN- Done Bit: - The done bit changes state whenever the accumulated value reaches the preset
value.
ACC- Accumulator Bit: - The accumulated value specifies the number of milliseconds that have
Pre-Preset Bit: - The preset value specifies the value (1msec units) which the accumulated value
The figure shows the timing diagram which illustrates the functioning of all the bits in sequence.
The timing diagram illustrates the functioning of all the bits in sequence.
The following example, will illustrate the function of each bit of Off Delay Timer after
high. When the start bit is toggled again i.e from high to low, the delay is provided and
When the q bit is energised the output DN bit goes high. The timer starts only after
timer. The same tag name is to be used in the new rung to test the status or to verify the
output status. You can also test the cascading of the timer using these bits.
Link: http://plc-coep.vlabs.ac.in/exp5/simulator5.html
Experiment No. 10
logical control. But it has limited capability of handling analog input and outputs as well
as analog control. PID control is available in PLC as a function. The theory behind PID
In this experiment students are expected to study all features of the PID block available in
As the name suggests this strategy is preferred for on –off type applications. This is a simplest
form of control. Chattering of contacts for final control element is major problem but it can be
avoided by addition of dead zone. Precise control is not possible due to addition of dead zone.
Mostly all domestic applications as Water Geyser, Electric iron, Electric Ovens are controlled
• Integral
• Derivative
Proportional mode: -
In this mode the controller output varies linearly with respect to the error.
m = Kp * e + Po
Where:
e is the error in %
Due to addition of proportional bias, positive as well as negative errors are handled.
Generally Po is set at 50% to handle equal positive and negative error range. Higher is the
Integral mode: -Integral mode is used to remove the offset produced due to P mode. Offset
When this action is used alone due to integral effect the action becomes too slow. When
combined with Proportional, the action may go into saturation which is called as Reset Windup.
To overcome this, controller output is limited at lower and higher end. This is called as Anti reset
Derivative mode:-This action is used to increase the speed of response of slow processes. It
anticipates the rate of change of error and takes the control action. Equation for Derivative mode
is
Where,
Set Point can be achieved quickly by using D mode. In noisy environment. this action is not
used as the output goes into saturated condition. Even for constant error D action provides no
Composite controller, i.e. P, I and D adds advantages of all the three modes.
The Equation for the combined controller depends on how P, I, D blocks are combined. There
Loop tuning time can be optimized by using proper combination of PB, Ti and Td
The process parameter analog value (PV) is given as input to the block. Various settings such
direct or reverse action, Proportional band setting, Set point value, Proportional band,
Proportional gain, Derivative gain, Integral gain etc. are configurable parameters available in
PID function.
Procedure:
4. Now right click anywhere on PID function block to configure the block.
5. Once you configure the tags, you can set the action, PID mode, type of PID etc.
Link: http://plc-coep.vlabs.ac.in/exp8/simulator8.html