0% found this document useful (0 votes)
92 views24 pages

PLC PRACTICAL ALL - Compressed K (

+h-hhhjjjjj

Uploaded by

Harsh Jaiswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views24 pages

PLC PRACTICAL ALL - Compressed K (

+h-hhhjjjjj

Uploaded by

Harsh Jaiswal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

INDUSTRIAL AUTOMATION & PLC LAB ( KEE- 751)

DEPARTMENTOF ELECTRICAL ENGINEERING

United College of Engineering and Research, Naini, Prayagraj

(Affiliated to Dr. APJ Abdul Kalam Technical University, Lucknow)

A-31, UPSIDC Industrial Area, Naini, Prayagraj-

211010 Website: www.united.ac.in

NAME:- Md Atique Khan

ROLL NO.:- 31

BRANCH:- Electrical Eng.

SECTION:- 4N
EXPERIMENT - 01

Aim : To study hardware and software associated with PLC.


Objective:-
1. Learn the basics and hardware components of PLC
2. Understand configuration of PLC system
3. Study various building blocks of PLC
Evolution of PLC:-
When the first electronic machine control was designed, relays were to control the machine logic. Relay logic has
its own limitations.
1. Less reliability
2. The delay involved in switching of contacts
3. Less flexibility and difficult troubleshooting due to hard wired connection
What is PLC?
A Programmable Logic Controller , PLC, or Programmable Controller is an electronic deviceused for Automation
of industrial processes, such as control of machinery on factory assembly lines. A programmable controller is a
digitally operating electronic apparatus which uses a programmable memory for the internal storage of instructions
for implementing specific functions, such as logic, sequencing, timing, counting and arithmetic, to control various
machines or processes through digital or analog input/output devices.Unlike general purpose computers, the PLC
is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical
noise, and resistance to vibrations and impacts.
Programs to control machine operation are typically stored in battery-backed or non volatile memory. A PLC is
an example of a real time system since output results are produced in response to input conditions within a bounded
time, otherwise unintended operation results.
Basic Components of PLC:-
1. CPU and Memory module
2. Power supply
3. Input and output module
4. Programming device

• CPU and Memory Module:-


This is the device where PLC program is stored and processed. The size and type of CPU determines the
programming functions available, size of the application logic available, amount of memory supported,
and processing speed.
• Power Supply:-
The power supply provides power for the PLC system. It provides internal DC current to operate the
processor logic circuitry and input/output assemblies. This can be built into the PLC or an external unit.
Common voltage levels required by the PLC are 24Vdc, 120Vac, 220Vac. , is used to determine
temperature.
• Input and Output Module:-
Inputs carry signals from the field (process) to the controller. Various types of inputs can be switches,
pressure sensors, transmitters etc. The field devices to whom PLC sends the results of logical operations
are the output devices. These are the actuators that adjusts or control the process, motors, lights, relays,
pumps, etc. Many types of inputs and outputs can be connected to a PLC and they can be categorized
mainly as analog and digital. Digital inputs and outputs operate on discrete or binary change i.e. on/off,
open/close. Analog inputs and outputs change continuously with reference to time.
• Programming Device:-
The PLC is programmed using a special software using computer or hand Held Terminal(HHT) that can
load and change the logic inside.
Operation of a PLC system:-
The operation of the PLC is determined by 3 steps.
1. Reading the field status form input devices
2. Execution or solving the logic, and
3. Updating the output devices status.

PLC Program:-
PLC Program is a Logic that is executed by the CPU.
This logic can be written in the form of Ladder
diagram, Instruction List, Sequential Function
Charts, Structured text or Functional block diagram.
These are the languages used for writing logic as per
IEC standard. The program is then downloaded to the
PLC. This is usually done by temporarily connecting
the PC or HHT to the PLC. Once the program is
downloaded to the CPU, it is usually not necessary
for the PC to remain connected.
PLC Scan:-
Once the program is downloaded in the CPU, the PLC is switched to "run" mode and the PLC executes the
application program. The CPU regularly reads the status of the input devices, and sends data to the output devices
as per the logical results after execution of the program. The process of Initialization when power is turned on,
Reading inputs, Executing logic, and modifying outputs is called as PLC Scan Cycle.

Memory:-
The logic or application program is stored in memory. As the PLC executes logic, it may
also read and store values to memory. The values may be referenced by the application
program.
Input and Output Devices:-
Two major types of Input/Output modules are
1. Digital - binary devices which must be in one of the two states: on or off.
2. Analog - continuos devices - sense and respond to a range of values.
• Digital I/O
Common digital field input devices include pushbuttons, limit switches, photo
sensor etc. Common digital output devices include relays, motor starters, and solenoid valves.
• Analog I/O
Common analog input devices are transmitters used for sensing various parameters. Common output
signals include motor speed, valve position, air pressure, etc.
I/O modules connect "real world" field devices to the controller. They convert the electrical signals used in the
field devices into electronic signals that can be used by the control system, and translate real world values to IO
table values.

I/O Wiring:-
Example of Input Module Wiring Diagram:-
Example of Output Wiring Diagram:-

Sinking and Sourcing Operation:-


• If the device provides current to during it’s on state, the device is said to be souring current.
• If the device receives current in the ON or true state, then it is sinking current.
Procedure:-
1. Once you open the simulator, at the left side you will see the library of nomenclature and symbols.
2. You have to classify the symbols in the various categories as AI, AO,DI and DO.
3. Left click on the nomenclature and symbols one by one and drag it to the right side (Workspace) to
build the architecture of the PLC.
EXPERIMENT - 02

Aim : To understand Simple Ladder program.


Objective:-
1. Develop a ladder using standard procedure.
2. Solve the problem using ladder programming.

Pre-requisites:-
Basics of Digital Electronics and Boolean Algebra:
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.
The resulting digital signal has following advantages:
1. storage over arbitrary periods of time.
2. flawless retrieval and reproduction of the stored information.
3. flawless transmission of the information.
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. ', 'l'

Logic:
What can a digital circuit do? 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, the process has no time delay. , is used to
determine temperature.
X= It is a sunny day? Yes
Y = Is it Sunday or holiday? Yes
Action Z = Go for shopping
The rule is Z = X and Y. The circuit is a simple AND gate.
Truth Tables:
Boolean Algebra:
Logic can also be expressed in algebraic form. e.g.Truth Table for AND gate:

Boolean Algebra Simplification:-


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 developed to mimic or imitate relay logic.
Relay Logic / Instructions A relay is simple magnetic device which acts as a control switch. When the switch is
on, current will flow through the coil on iron piece. This iron core acts a electromagnet and due to the magnetic
field upper contact gets attracted towards lower one and circuit gets completed, allowing current to flow from
load.
Ladder Programming
Ladder diagram is popular language of programming the PLCs. Ladder diagram shows the sequence of the logic
execution which is presented diagrammatically. In ladder diagram, 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 conditions must be fulfilled to change the status of the output coils.
Most commonly used relay instructions used in PLC programming are as shown in the table below.

Procedure:-
Important steps for developing Ladder using Simulator:
Please follow the steps so as to understand the procedure for developing ladder logic for various logical gates.
1. Prior to starting of the development of ladder diagram following steps needs to be understood:
• Understand the problem statement like test the logic for OR gate, AND Gate etc.
• Develop the logic on paper and validate the logic by considering various cases
• Prepare the truth table and test the logic using all valid cases
• Go to simulator icon and click on the “Simulator” button
• The PLC simulator will be opened in new window.
2. The procedure for writing the ladder diagram in the work space is as follows:
• Add a new rung by clicking on the 'Add Rung' icon.
• Place the contacts as per the requirement by left clicking the appropriate contact shown at the top side.
• 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.
• Please note that the tag names are case sensitive and if you are using them in circuit as bit make sure
that the correct tag name appears.
• 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 has to go to development
mode.
• By right clicking on the contact toggle the state of contact.Check the output contact status.
• 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.
• 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.
• To delete any contact or output right click on the contact and press “delete”, the contact will be deleted.
• You can add seven elements in series and 5 elements in parallel.
• 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.
• 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.
• 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.
• To delete any contact or output right click on the contact and press “delete”, the contact will be deleted.
• You can add seven elements in series and 5 elements in parallel.
• 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.
EXPERIMENT - 03

Aim : To develop a ladder program for DOL starter.


Objective:-
1. To understand working of DOL starter
2. Develop a ladder program for starting an electrical motor using DOL starter
Working of Direct-On-Line (DOL) starter:
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.

Listing of Input and Output devices: Inputs: PB1- To start the motor PB2- To stop the motor Output: M1- Motor
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, Motor (M1) should
remain on.
3. When Stop push button (PB2 is pressed, Motor (M1) has tol stop.
4. If stop push button is released and start is not pressed (released) motor shouldl remain off.
The Boolean equation to represent this sequence is

The ladder diagram to implement these equations is shown below.


As the momentary contact push buttons are used here, the condition of PB1 is maintained through contact of coil
C1. This contact is called as latching contact. The same sequence of event can be executed by using latch and
unlatch instruction in the following way.

Procedure:-
Open the Simulator window as described in the last experiment
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 again, the output bit
remains latched.
4. To unlatch the output you will have to toggle the input bit in the unlatch rung and the output will be de-
energised.
• 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.
• Observe the output status at different input conditions.
EXPERIMENT – 04

Aim : To develop an application using On-Delay timer.


Objective:
1. Study the timing diagram of On Delay Timer
2. Solve the assignment of Ton timer

PLC timers instruction is used to activate or deactivate a device after a preset interval of time.
Types of Timers available are:
1. On-Delay timer (TON)
2. Off-Delay timer (TOF)
3. Retentive timer on (RTO)
On-Delay Timer (TON)
It is used when an action is to begin a specified time after the input becomes true. 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 figure below shows a symbolic representation of
the timer.

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 have elapsed since
the TON instruction was enabled.
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 are ON and Lamp_2 will be
OFF.
The Function Block Diagram, Timing diagrams, and ladder diagram solutions are as per the available
PLC(Rockwell Automation) in College of Engineering Pune.
It will be better understood after the given example is developed on the simulator.
Procedure:-
Develop an application using On-Delay Timer
• In this experiment the on delay timer will be tested for its functionalities using Simulator. Following
bits of the timer are to be observed.
• Initialising bit "ON" in this case.
• Enable bit "T_en"
• Done bit "T_dn"
• Timer timing bit "T_tt"
• Preset value needs to be entered by the user.
• 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 block.
Submit tag and preset value.
• 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.
EXPERIMENT – 05

Aim: To develop an application using Off-Delay timer


Objective:
1. Study the timing diagram of OFF Delay Timer
2. Solve the assignment of Toff timer
Introduction:The timer concept and details of on delay timers with its terminology is discussed in the previous
experiment. Let us learn about Off-Delay Timer (TOF).

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, some time 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 elapsed since the
TOF instruction was enabled.

Pre-Preset Bit: - The preset value specifies the value (1msec units) which the accumulated value must reach before
the instruction clears the DN bit.

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 downloading the ladder
and taking the PLC in run mode.
For low to high transition of start bit, timer will start lamp 3 will glow, as T1.DN,bit is high. When the start bit is
toggled again i.e from high to low, the delay is provided and after 5 seconds delay lamp3 will be off.

Procedure:
Implement the operation using Simulator. The configuration of off delay timer is same as 'on delay timer'. A
typical difference can be observed in the operation (in Run mode) . When the q bit is energised the output DN bit
goes high. The timer starts only after toggling the initialisation bit again.

Implement the operation using Simulator. To test the EN, DN, and TT bits; Configure the 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.
EXPERIMENT – 06
Aim: To Develop an application using UP/DOWN counter
Objective:
1. Study Counter timing diagram
2. Develop an application specific ladder program using counters
Introduction: Counters are used to count number of objects or to count cycles of a typical process. Consider an
example of bottle filling plant, in that counter is used to count number of bottles filled in a particular batch. In
counter instruction the accumulated value will increase only when it completes the transition from open to close
or vice versa. It doesn't check how long contact stay closed, it only looks for the transition. There are two basic
types of counter
1. Up-Counter (CTU)
2. Down-Counter (CTD)
In Up counter when contact change over takes place accumulator value increments by one. While in down counter
when changeover takes place accumulator value decrements by one. The instruction blocks of up counter and
down counter are as shown below.

Count Up (CU) Bit: - The Count Up enable bit indicates the CTU instruction is enabled. The data type used is
Boolean indicated as BOOL.
Count Down (CD) Bit: - The Count Up enable bit indicates the CTD instruction is enabled.
Done (DN) Bit: - The done bit changes state whenever the accumulated value reaches the preset value. The data
type used is Boolean indicated as BOOL.
Overflow (OV) Bit: - The overflow bit indicates the counter exceeded the upper limit of 2, 147, 483, 647. The
counter then roles over to -2, 147, 483, 648 and begins counting up again. The data type used is Boolean indicated
as BOOL.
Underflow (UN) Bit: - The underflow bit indicates that the counter exceeded the lower limit of -2, 147, 483, 647.
The counter then roles over to 2, 147, 483, 647 and begins counting down again. The data type used is Boolean
indicated as BOOL.
Preset (PRE) Bit: - It specifies the value which the accumulated value must reach before the instruction sets the
done bit. The data type used is Double integer indicated as DINT.
Accumulator (ACC) Bit: - It specifies the number of transitions the instruction has counted. The timing diagram
illustrates the functioning of all the bits in sequence.
Timing Diagram for Up Counter:-

Timing Diagram for Down Counter:-


The following example, will illustrate the function of each bit of Up Counter after downloading the ladder and
putting the PLC in run mode.

Here for every transition of start bit, counter accumulator value will be increased by one and for every count lamp
1 will glow on. When accumulator value becomes 5, lamp3 will glow on. To reset the counter and make
accumulator value zero, reset bit is used. The following example can illustrate the function of each bit for Down
Counter.

Here accumulator value of CTD is 9. For each transition of start bit this value will be decremented by one.
Whenever start bit becomes on, lamp1 will glow on. Lamp3 will remain on till accumulator Value becomes greater
than or equal to preset value. When it becomes less than preset then lamp3 will glow off.

Procedure:
Implement the counter using Simulator
The counter counts the pulses received at input. The pulses can be given by toggling the input bit "ON" in this
case. The counter will keep on counting till it reaches the preset value set by the user. Once the accumulator is
equal to preset the DN bit will be energised. After this instant if next pulse is detected the accumulator will
increment without changing the status of DN bit. To reset the counter use "Reset" command so that the counter
can be configured for new counts without reloading the Page. Please note the tag of the reset bit must be the tag
of counter e.g."CTU".

In case of down counter the entire procedure will remain same. Only the number of counts are to be entered in the
accumulator tab. The preset value is zero. When the input contact closes, the accumulator will go on decrementing,
will reach to zero '0' value and the status of done bit will change. To reset the DN counter use "Reset" command
so that the counter can be configured for new counts without reloading the page. Please note the tag of the reset
bit must be the tag of counter.
EXPERIMENT – 07
Aim: To simulate analog and digital function blocks
Objective:
1. Study various Function Blocks available in DCS.
2. Develop FBD program using basic digital and analog function blocks.
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. There are several programming languages
used for logic development. The IEC 61131 standard part3 specifies these languages as:
1. Ladder Logic (LD)
2. Structured Text (ST)
3. Instruction List (IL)
4. Sequential Flow Charts (SFC)
5. Functional Block Diagram (FBD)
Generally in DCS Functional Block Diagram (FBD) is used for programming and Sequential Flow Charts (SFC)
is preferred for batch control applications.
Functional Block Diagram (FBD) Basics:
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 describes a function between input and
output variables. 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 block to a complex control strategy.
Generally available Function blocks are:
1. Input/ Output (I/O)
2. Math
3. Logical
4. Timer/ Counter
5. Analog Control
6. Advanced control
A Typical Function block -

The description of the various parameters associated with this block:


• 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.
• Execution number: The number by which the function block is executed.
Following functions blocks are generally available in the libraries.
1.Input Output library
• 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
• Negative Edge Trigger
• Positive Edge Trigger
• Multiplexer
• De multiplexer
4.Timer / Counter Library
• On Delay Timer
• Off Delay Timer
• Counter
• Retentive Timer
• Timed Pulse
5.Analog Control Library
• 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 function Block
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 engineering units as well as output is indicated
in engineering units on the screen. 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 function Block


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.
Discrete (digital) Input (DI) Function Block
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.

Discrete (digital) Output (DO) Function Block


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 solenoid valve, changes.

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 are high the output of
the function block is high.
The function block and the truth table is as given below:

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 are as given below:

Let us look at how programming is done using these blocks. The details are given in under procedure tab.

Procedure:
Part 1: Understanding the operation of AI and AO function block
1. First left click on AI block available under IO tab. Drag this block to required position preferably left
side and vertically at center.
2. Now left click on AO block. Drag it and put it next to AI block.
3. Take the cursor to the color dot at the output side of AI block. Move it by left clicking and take it to the
color dot at the Input side of AO block.
4. Now click on Compile tab. If any compilation errors are there, it will be shown. Otherwise Run tab gets
activated.
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. For clearing the workspace, Clear
tab is available.
Part 2: Understanding the operation of DI and DO function block
Follow same procedure as above to get the bolcks 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.
Part 3: Understanding the operation of Logic function block
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 DO block in the workspace.
2. Left click on any logic function block e.g. AND function from Logic Tab available in the left hand panel.
3. Connect output of DI1 to one of the inputs of AND block.
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. Otherwise Run tab gets activated. 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. 7. Verify the AND gate truth table by changing DI status. Similarly verify the truth tables for OR and NOT
Logic Gates.
EXPERIMENT – 08

Aim: To study, understand and perform experiments on timers and counters.


Objective:
1. To understand timers and counters used in DCS
2. Development of application using Timer and Counter blocks
Concept of Timer
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 where in 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 becomes
high only after the specified time duration is elapsed. 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 diagram and timing diagram of the same is shown below:
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
Two types of counters are generally used in DCS.
1) Up Counter: Up Counter counts input pulses in incremental manner i.e. it starts counting from 0 to the value
specified as preset value. When the preset value and no of counts becomes equal the output of the counter becomes
high.
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 decrements to 0 value, the output of the counter becomes high.
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. The block diagram of counter and its timing diagram:
Procedure:
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 procedure mentioned
in step 1.
5. Connect the output of DI block to input of TON block and output of TON block to input of DO block.
6. Right 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 preset value is 1000.
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 by using right
click.
9. Observe the accumulated timer value. When it becomes equal to preset value, the timer output and the
Do block output is set to 1.
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 available under
Timer tab.
13. Repeat steps 5 to 9. 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 changed to
0 or Off state.
Part 2: Understanding the operation of Up and Down counter
1. To configure the counter circuit, first reload the page by clicking Clear tab.
2. Refer step 1 mentioned in part 1 to drag DI block.
3. From the panel, click on COUNTER; click on UP, to select Up Counter block. Put this block next to DI
block.
4. Next to UPCTR block, take DO block to observe Up Counter operation. Follow the procedure mentioned
in step 2.
5. Connect the output of DI block to input of UPCTR block and output of UPCTR block to input of DO
block.
6. Rght bclick on the UPCTR block to configure. Enter required count (preset) value after which the output
is to be set.
7. When configuration is done, click on complile tab to activate Run tab.
8. To understand the counter operation, Change the DI value by toggling. You need to use right click for
this.
9. Observe the accumulated count value.
10. Change the DI value to 0 again and observe the output status.
11. Repeat step 8 to 10 till the accumulated value becomes equal to preset. When accumulated value becomes
equal to preset, the counter output and the Do block output is set to 1.
12. Do not forget to drag and drop Reset block available under Counter tab to restart the counter.
13. To observe the operation of down counter, go back to compile mode by pressing Stop tab. Now replace
the UPCTR block with DWCTR counter block.
14. Right click on UPCTR block. Select delete and delete the block. From the panel, select DOWN block
available under Counter tab.
15. Repeat steps 5 to 11. In case of down counter, the preset value is loaded in accumulator when the
simulator is taken to Run mode. On every transition of input from 0 to 1, accumulated value is
decremented by 1. When accumulated value becomes equal to 0 the output of counter is set to 1.

You might also like