Industrial Electronics Lab Manual UOC

Download as pdf or txt
Download as pdf or txt
You are on page 1of 81

Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal

Industrial Electronics Lab Manual (EE-422A)

Experiment # 01

Objective:
Introduction to Programmable Logic Controller (CLO-1)
What is PLC?

It was named “Programmable Logic Controller (PLC)” by NEMA (National Electrical Manufacture
Association) in 1978.
In automated system, PLC is the central part of the process control system. With execution of a program
stored in the program memory, PLC continuously monitor the signal status from the input field devices and
read the external input signal and feedback signals from such as switches, sensors and keypad etc. Based
on the logic implemented in the program, using Microprocessor to execute the calculations of logic,
sequence, timer, counter and formula according to the status and the value of the input devices. PLC will
execute the action with the output device, such as open or close of relay or solenoid, control of AC or DC
motors and other control equipment.

PLC Components:
PLC is an industrial microprocessor system where you have hardware and software especially adapted
according to industrial environment. PLC consists of following components.

• Central Processing Unit


• Input/output Units
• Communication section
• Memory

Fig. Block Diagram of PLC

1
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

• Central Processing Unit


The principle operation of CPU is to accept (reads) input data from sensing devices, executes the
user program from memory and activates output devices.
• Programming Device
The Programming device is used to enter the required program into the memory of the processor.
The program is developed in the device and then transferred to the memory unit of the PLC.
• Input/Output Units
Input/output modules are where the CPU receives information from external devices and
communicates information to external devices. Input devices are (e.g. start and stop pushbuttons,
sensors, limit switch, selector switch) and output devices are (e.g. lights, solenoid valve, relays,
buzzer, fan).
• Communication Section:
PLC will communicate with computer through RS232 for programming the PLC and On-line
monitoring of program or for Handheld Programming Device.
• Memory Section:
There are various type of memory units. It is the area, which contains the operating system and user
memory. The operating system is actually a system software that co-ordinate the PLC. Ladder
Diagram, which is converted to a binary form of the user program, is stored in the User memory.
System memory is used by a PLC for a process control system mostly used in flash memory.

PLC Scan Time:

The process of reading the inputs, executing the ladder program and updating the outputs is known as scan
and the time taken during this process is called scan time. The scan cycle is continuous, sequential process
of reading the status of inputs, evaluating the control logic in program and updating the outputs according
to logic as shown in fig. Scan time of a controller shows that how fast a controller reacts to the field inputs
and correctly solve the control logics used in program.

The scanning process has three basic steps:

Step 1: First, a PLC checks the status of each input devices that are connected with the PLC inputs that
which input is ON or OFF. Then the status is stored in the memory for used in step 2.

Step 2: After checking the inputs status the PLC execute a program instruction by instruction. The complex
mathematical instructions, formulas and calculation are solved. After execution of program step by step
until the end, all the calculations are stored in the memory for next step.

Step 3: Based on the program and input devices status the output field devices are adjusted. After this, first
scan is completed and the program scans again repeating from step 1. This process is repeated again and
again.

The single scan time of program of PLC controllers typically varies from 0.1ms to Tens of ms depending
on the CPU processing speed and length of the user program. If the scan time increases from the set value,
then the error flag will be set high and program will malfunction.

2
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. PLC Scan Time

Introduction to Ladder Diagram

Ladder Diagram is a graphical programming language developed in World War 2 by combining different
graphic elements. Ladder logic is used to develop software for programmable logic controllers used in
industrial control applications. They are called “ladder” diagrams because they are constructed in a way
that resembles a ladder with two vertical rails and rungs between them.

At first, it just has basic components, such as a contact NO (Normally Open), NC (Normally Close), output
coil, timer and counters etc, which were used in the control panel. But as PLC controllers are developed it
has more functions, different contacts, latched coils, and application commands, arithmetic instructions and
many more complex commands that traditional power panel don’t have.

The working principle of the traditional ladder diagram and the PLC ladder diagram are similar to each
other, the only difference is that the symbols for the traditional ladder diagram are expressed in the format
that are close to its original component, while those for PLC ladder diagram employ the symbols that are
more explicit when used in the computers and data sheets as shown in the Fig. (a) and Fig (b).

3
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig (a). Traditional Ladder Program for Motor Control.

Fig(b). PLC Ladder Program for Motor Control.

4
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Logic Diagram Instructions:

• Input instructions are entered on the left


• Output instructions are entered on the right.
• The power rails simulate the power supply lines
▪ L1 and L2 for AC circuits and +24 v and ground for DC circuits.
• Each rung contains one output at least.
• A particular input can appear in more than one rung of a ladder.
• The processor (or “controller”) scans ladder rungs from top-to-bottom and from left-to-right.
▪ The basic sequence is altered whenever jump or subroutine instructions are executed.
• The inputs and outputs are all identified by their addresses, the notation used depending on the PLC
manufacturer.

Fig. Ladder Diagram Scan Sequence

Normally Open (NO) and Normally Close (NC):

Since we frequently meet with concepts “Normally Open” and “Normally Close” in the industrial
environment. Both terms are applied to words such as contacts, inputs; outputs, etc. (for example normally
open contact, normally close contact). Normally open switch will not conduct electricity until the switch is
not pressed. When the switch is pressed, the contacts will meet and they will pass electricity. Similarly, the
normally close switch will conduct electricity until it is not pressed. Because as it name shows that its
contacts are already close so when the switch is pressed the contact will open and the passage of electricity
will stop.

5
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Example:
Here a doorbell is connected with a NC contact as shown in fig. It means that when the power is ON, the
bell will ring continuously until someone opens NC contact.

Fig. Doorbell connected with a NC point

Let’s take a common relay operated with 12VDC which have two contacts i.e. NO and NC. Two 24VDC
lamps one Red and other Green are connected with there NO and NC contacts respectively as shown in the
fig. 2-8. As the relay is not activated, the NC contact i.e. Green lamp will glow and the NO contact i.e. Red
lamp remains in OFF state. When the relay is activated the Normally Open (NO) contact will close and Red
lamp will start glowing, and the Normally Close (NC) contact will open and Green lamp will turn OFF.

Fig. 12VDC Relay with NO Start Switch

The concept of “Normally Open” and “Normally Close” can also be applied to sensors, limit switches,
valves and other input devices as well. Like NO/NC input contacts, this concept can also be applied to
output devices i.e. Normally Open Output and Normally Close Output. For example, if the COM & NC
points are used as output, it will remain ON continuously unless the relay is energized. The fig above shows
this. If this relay is energized, then the function will be totally inverted of the above function as shown in
fig below.

6
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. 12VDC Relay with NC Stop Button

Architecture of Delta’s PLC (DVP-14SS)

DVP-14SS consists of I/O address, memory areas, data memory, timers and counters areas.

DVP-14SS PLC Controller:

The DVP-14SS series provides 14-I/O points on the CPU unit and the extension units with 16-I/O point
relays or transistors based, analog I/O unit are available. The maximum I/O points can be extended up to
128 points either input or outputs. The power supply unit is independent of the main CPU unit. DVP-14SS
controllers can be seen in the Fig.

• Power LED: When the PLC controller is connected with the 24VDC then the power LED will
glow up. If the LED is not lit, it means that the connection is wrong or the 24VDC terminal is
overloaded.
• Run LED: After the program is transferred to CPU unit and the Error LED is not blinking, then
the program is OK. Now make the RUN/STOP button on the unit to RUN position or by selecting
the RUN option in the Ladder software menu, the Run LED will glow and PLC will start function.
While working always keep the switch in Run position.
• Error LED: if there is any Error in your program or any problem with the power supply then the
Error LED will light up. If the LED blinks continuously, it means that the power supply of PLC is
low or if the LED is lit permanently then there is a problem with your ladder program.
• RUN/STOP button: After ladder program is transferred to CPU unit of PLC and there is no error
in program, then through this button you can run the PLC controller manually. While working
always keep the switch in Run position.

7
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. CPU Unit Front View

• Communication Port: (RS232). PLC controller communicates with the Host computer and
Handheld programming console, Programming Terminal through this serial port
• I/O terminals and Indicators: I/O terminals are points for connecting the external input/outputs.
These points are also indicated by their name such that for inputs X0, X1, X2 etc. and for outputs
Y0, Y1, Y2, etc. There is also an LED indicator for each I/O point.
• RS485 communication Connector: RS485 communication is twisted pair communication which
used for the communication between HMI (Human Machine Interface) i.e. PT (Programmable
Terminal) Screen and with other RS485 devices.
• Power Supply Connector: CPU unit of the PLC controller is powered up through this connector.
A 24VDC power supply is connected to this point and then the power LED will be lit.
• Extension Port: This port is used to connect the extension unit of PLC controllers i.e. I/O unit,
analog I/O, etc.
• Nameplate: The nameplate explains the PLC Model No., I/O Power supply specification, Bar code
and Serial No. and Software version.

8
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

PLC Controller Input Connections:

The DVP-14SS PLC have 8-Inputs with a common point S/S. The input addresses of delta PLC are
represented by “Xn” where “X” is input and “n” is input number. For example, X0, X1, X2, X3, X4, X5,
X6, and X7 represents the CPU 8-input addresses. The connections of the CPU inputs with switches are
shown in the figure.

Fig. PLC input lines and Power connection.

PLC Controller Output lines:

The DVP-14SS CPU have 6-Outputs and three common points. The PLC outputs addresses
are represented by “Yn”, where “Y” shows the output and “n” represents its output number
1.e. 0,1…7. The 6-output of CPU will be represented by Y0, Y1, Y2, Y3, Y4, and Y5. If
further outputs are required, then Extension Unit will be used. The connections of external
output devices are shown in figure.

9
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. PLC Output connection and their Addresses

DVP-14SS PLC controller Memory Structure:

Memory Structure of the PLC is shown in Table, which have some specified area for I/Os relays, Internal
Relays, Data memory, Timer and Counter Area, and Error Area. These areas are pre-defined by
manufactures. Basic introduction to some internal memory areas:

• Input Relay:
Input relay is the basic storage unit of the memory that corresponds to the external input. Input
signal from outside will decide the logic “0” or “1”. The status of Input and Output relays in the
memory couldn’t be changed by program design or via HPP (Handheld Programmer). X0, X1, X7,
X10, X15, and X20 etc represent the input relays. The “X” represents the input and the decimal
number shows their position or Input number. The contacts of any input can be used unlimitedly in
the ladder program.
• Output Relay:
Output relay is the basic storage unit of the memory that corresponds to external output. Y0, Y1,
Y7, Y10, and Y20 etc represent output relays. The “Y” represents output and the decimal number
shows the output relay number.
• Internal Relay:
The internal relays are not connected directly to the external outputs. These are the auxiliary relays
in the PLC. Its function is the same as the auxiliary points in the control circuits i.e. to monitor
some conditions. The representation of internal relays is “Mn” where “M” represents the internal
relay and “n” shows its number i.e. M0, M5, M10, M25 etc.

10
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

There are some special auxiliary relays, which are predefined and given in the datasheet. These auxiliary
relays have special functions for example,

▪ M1000 is Normally-ON contact means that it is always ON.


▪ M1001 is Normally-OFF contact means that it is always OFF.
▪ M1002 is On only for one scan after Run.
▪ M1004 is On when error occurs.
▪ M1009 is On when power supply (24VDC) is low.
▪ M1011 is 10msec clock
▪ M1012 is 100msec clock
▪ M1013 is 1sec clock

DEVICE DESCRIPTION USAGE RANGE TOTAL


X External Input Relays X0-----0-1-2-3-4-5-6-7 128 Points
For External Input Devices X1-----0-1-2-3-4-5-6-7 (Octal
i.e. Switches, Buttons, X2-----0-1-2-3-4-5-6-7 Number
Sensors etc. - System)
X7-----0-1-2-3-4-5-6-7
X10----0-1-2-3-4-5-6-7
-
X17----0-1-2-3-4-5-6-7
Y External Output Relays Y0-----0-1-2-3-4-5-6-7 128 Points
For External Output Devices Y1-----0-1-2-3-4-5-6-7 (Octal
i.e. Motors, Valves, Lights & Y2-----0-1-2-3-4-5-6-7 Number
Lamps etc. - System)
Y7-----0-1-2-3-4-5-6-7
Y10----0-1-2-3-4-5-6-7
-
Y17----0-1-2-3-4-5-6-7
M Internal/Auxiliary Relays M0~M511, 744 Points
General M768~M999

Latched M512~M767 256 Points

Special M1000~M1279 280 Points

T Timer Area T0~T63 64 Points


100ms
10ms T64~T126 63 Points
If M1028=ON it is 10ms
If M1028=OFF it is 100ms
1ms T127 1 Point
C Counter C0~C111 112 Points
16 Bit UP Counter General
16 Bit UP Counter Latched C112~C127 16 Points
32 Bit High Speed Up/Down C235-C254 13 Points
Latched Counter

11
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

These are some important internal relays, which can be used freely in the ladder diagram. Some special
internal relays are Read Only, which cannot be changed, and some special relays can be changed according
to your requirements.
• Timer Area: Timer is used to control a time period. There are coil, contact and timer storage unit in
instruction of timer. When a time delay is required then a timer coil is activated and the time set
value is entered. When the desired time is achieved then the contacts are activated. Each timer has
its base timing period, which is shown in datasheet. Timers have base time 100ms, 10ms, and 1ms.
There are 128 timers from T0~T127. Timer is represented by “Tn” where “T” represent timer and
“n” shows the timer number.
• Counter Area: Counter is used for count. The counter instruction contains coil, contact and counter
storage unit. Before using a counter it is set by an instruction in ladder program. There are 16-bit,
32-bit, and high-speed counter. The counter is represented by “Cn” where “C” is counter and “n”
is counter number. There are 128-counters from C0~C128 and high-speed counter C234~C254.
• Data Register: PLC needs to handle data and operation when controlling each order, timer value and
counter value etc. The data register is used to store data or parameters. It stores 16-bits data as a
word and 32-bits data as a double word. There are some latched data areas, which store data
permanently i.e. it, retains data if the power is failed and some unlatched area, which lose data on
power failure. The data area is given in the PLC datasheet. The data register is represented by “Dn”
where “D” is the data area and “n” shows its location. For example, D0, D1, D2, D100, D500 etc.

Some special data registers are:


▪ D1000 is watchdog timer value. Watchdog timer is used if the scan time of your ladder
program increases from the value set in this data register.
▪ D1001 shows the PLC model number and memory capacity.
▪ D1004 shows the error flag number.
▪ D1010 shows the current scan time.
▪ D1061 shows the detailed error codes.
Some of the special data registers are Read Only, which cannot be changed, and some special register
can be changed according to your requirements.

Introduction to Basic Instructions

After using the basic techniques of the WPL Software now lets read about the basic instructions used in the
Ladder programming. After reading these instruction we will be in position to write some simple Ladder
programs for small control system.

The command or instructions, which are used in the next Module # 6, are:

S.No Command Operands


Code Function

1 LD Input/Load NO Contact X, Y, M, T, C

2 LDI Input/Load NC Contact X, Y, M, T, C

3 LDP Rising Edge NO Contact X, Y, M, T, C

12
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

4 LDF Falling Edge NO Contact X, Y, M, T, C

5 AND Series Connection of NO Contact X, Y, M, T, C

6 ANI Series Connection of NC Contact X, Y, M, T, C

7 OR Parallel Connection of NO Contact X, Y, M, T, C

8 ORI Parallel Connection of NC Contact X, Y, M, T, C

9 OUT Output NO Coil Y, M,

10 RST Reset or Clear Command X, Y, M, T, C, D

11 TMR Timer Command K, H, D

12 CNT Counter Command K, H, D

13 INV Inverting Command None

14 CMP Compare Command Y, M, D, T, C, K, H

15 ZCP Zone Compare Command Y, M, D, T, C, K, H

16 SFTR Shift Data to Right Side Command X, Y, M, K, H

17 SFTL Shift Data to Left Side Command X, Y, M, K, H

18 MOV Move Value Command K, H, T, C, D

19 ADD Addition Command K, H, T, C, D

20 SUB Subtraction Command K, H, T, C, D

21 DIV Division Command K, H, T, C, D

22 MUL Multiplication Command K, H, T, C, D

23 INC Increment a Value Command T, C, D

24 DEC Decrementing a Value Command T, C, D

25 END End Function None

The above-mentioned commands should be read carefully, with their given operand. The operands mean
that which memory areas in the PLC these commands can be used. The operands given are used for:

• X = External Input Devices i.e. X0, X1, X2…


• Y = External Output Devices i.e. Y0, Y1, Y2…
• M = Internal Relays of the PLC i.e. M0, M1, M2…

13
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

• T = Timer Contact i.e. T0, T1, T2….


• C = Counter Contact i.e. C0, C1, C2…
• D = Data Memory i.e. D0, D1, D2….
• K = Decimal Values i.e. K10, K100, K128….
• H = Hex Values i.e. H1, HC

• KnX = Means that how many External inputs can be read at one time. If K1 is used then it will read
four consecutive inputs starting from the following address i.e. K1X0 mean that four External
inputs from X0 t0 X3 will be read and if K2X0 then eight consecutive inputs will be read from X0
to X7 and so on.

• KnY = Mean that how many External outputs can be set high at one time. If K1 is used then it will
write to four consecutive outputs starting from the following address i.e. K1Y0 mean that four
External Outputs from Y0 t0 Y3 will be set high or turned ON and if K2Y0 then eight consecutive
outputs will be set high or turned from Y0 to Y7. Similarly, by using KnM the work bits M can be
set.

Addressing of Delta PLC Training Workbench

Digital Inputs Digital Outputs


Push Button Toggle Switch Light Emitting Diode
Address Input Address Input Address Output Address Output
X0 DI-1 X24 DI-13 Y0 DO-1 Y26 DO-13
X1 DI-2 X25 DI-14 Y1 DO-2 Y27 DO-14
X2 DI-3 X26 DI-15 Y2 DO-3 Y30 DO-15
X3 DI-4 X27 DI-16 Y3 DO-4 Y31 DO-16
X4 DI-5 X30 DI-17 Y4 DO-5 Y32 DO-17
X5 DI-6 X31 DI-18 Y5 DO-6 Y33 DO-18
X6 DI-7 X32 DI-19 Y20 DO-7 Y34 DO-19
X7 DI-8 X33 DI-20 Y21 DO-8 Y35 DO-20
X20 DI-9 X34 DI-21 Y22 DO-9 Y36 DO-21
X21 DI-10 X35 DI-22 Y23 DO-10 Y37 DO-22
X22 DI-11 X36 DI-23 Y24 DO-11
X23 DI-12 X37 DI-24 Y25 DO-12
Analog Input Need to Read control register using “From” instruction
Analog Output Need to write control register using “To” instruction

14
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 02

Objective:
Familiarization with Ladder Logic Programming using WPLSoft in PLC
(CLO-2, CLO-3)
Programming of DVP-14SS PLC Controller:

WPL is a PLC programming tool for the creation, testing and maintenance of programs associated with
Delta’s EX-series, SS-series, EH-series PLCs. It provides facilities to program the PLC I/O devices, On-
line monitoring and changing of data register (D) and internal relays (M).

Connecting PLC with a PC:

The DVP-14SS series is connected with Host computer through a serial port RS232 cable. One end of the
cable is connected to the PC serial port (DB9 or DB25) while the other side round pin connector is
connected with the DVP-14SS CPU as shown in the Fig.

Fig. Connection between PLC and PC

Installation of WPL Software:

• The DVP-14SS training kit comes with a CD, which contains a folder with the WPL software. The
WPL software can be setup in Window 95, Window 98 or Window 2000 etc.
• The minimum system requirements for WPL software are Operating System:
▪ Window 95 or above

Now let’s start installation process in the following steps:

1. Insert the CD in the CD-drive and click on the WPL Software folder.
2. Then run the SETUP.EXE then the installation process will start

15
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

3. Then a window will appear, click “Next” button and then give user information i.e. name
and company name.
4. Then click “Next” and browse where you want to install the software and then click
“Next” button.
5. Select the “program folder” and click “Next”.
6. “Start copying file” window will appear and click on “Next” button.
7. Then the setup will be started and files will be copied to the specified folder. After
completing the setup process the “setup complete” window will appear and select the
“Launch the program file” on this it will launch the WPL software and then click
“finish”, it will complete the setup process

Program Execution:

When installation is completed, Double click WPLSoft icon to execute the program. The WPL editor
window will pop up. There are only File, View, Communication, Options and Help in the toolbar when
executing WPLSoft for the first time.

Fig.WPL Software window

Launching a New Project:


Create a New Project as <File>--<New> or Click on the New icon.
Then the “Machine type setting” window will appear.

16
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Creating a New project

Fig. “Machine type setting” window

In this window you will have to give the “Title” of your program, PLC controller “Model or Machine type”,
and give a name to your file in “File Name”. Let’s give our program a Title i.e. say “Test”, PLC model is
“SS” and File name is “Dvp1”. Then click “ok” will open two windows on your screen one for “Ladder
diagram mode” and the second for “Instruction mode”. The “Title” and “File Name” will also appear on
the top of title bar of your screen.

When the above setting is finished, 2 sub windows will pop up. One is Ladder Diagram Mode and the other
is Instruction List Mode. Users can choose their favorable editing mode for programming PLC instructions.

17
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Ladder and Instruction Mode window

PLC status bar

The PLC status bar shown on the bottom of the window, indicates PLC series, steps used in ladder & the
total steps capacity and the instruction used location in the Window i.e. Row & Column.
• Ladder Mode: PLC controllers are mostly programmed in Ladder programming language,
because it is easy to use and their familiarity to technical personals. In this Lab, we will also use
ladder mode as a programming language. So maximizing the “Ladder Diagram Mode” will use
for ladder diagram and title bar will also show the “Ladder Diagram Mode”.
• Instruction Mode: Those, who are familiar to C-language or BASIC programming language or
have use Assembly Language for programming, can also use “Instruction Mode” for PLC
programming.

Some Important Ladder Software Tools and Shortcuts Bars:

Figure shows some icons which can be freely used for the creating ladder, communication (PC to PLC) and
monitoring (Online or Offline) etc. These icons can be accessed from the Main Menu bar.

This icon will bring you to the Instruction Mode window. If someone want to use Instruction
Mode, then this icon can be used or from Menu bar <View>--<Instruction Mode>.

18
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Clicking on this symbol will open the Ladder Mode Window or this can be also performed from
main menu bar as <View>--<Ladder>.

Clicking on this icon will open a window as shown in the Fig. In this window you can write your
comments or give a name to Inputs (X), Outputs (Y), Internal Relays (M) and Data registers (D) etc. In the
“View/Edit” window there are “*”, “Device” and “Notes” areas, firstly if on the right side of any “X”, ”Y”,
“M”, “D” devices etc. have “*” it mean that it has been used in the present ladder program. “Device” shows
the inputs, outputs, internal relays, and data register etc and “Notes” shows their comments. Once you write
your comments to Inputs, Outputs, Internal relays, Data register, Timer and Counters etc. save these
comments and then comeback to Ladder mode. There is also a second window “Comment used” containing
the special internal registers (M) with their comments and special data registers (D) with their comments.
On the Main Menu <view>--<Device Comments> will also open the same window.

Fig. Devices comments window

The comments written in the above section can be shown on Ladder with the help of this icon.
Clicking on the icon will show your comments on each “X”, “Y”, “M” and “D” areas etc. in the ladder
program. Again clicking this icon will hide the comments in ladder program. From main menu the
<View>--<Comments Show> will also do the same work.

Clicking on this icon will bring to the Ladder Program to the On-line Monitoring if the PLC is
running. On-line monitoring mean that user will also see the status of I/O devices and internal relays, values
of timer and counters, changing data of Data register etc. When an external input or output device change
from OFF to ON state or the status of internal register changes or the contacts of timer and counter changes

19
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

from Low to High, then it will be shown as green color on ladder program in the on-line monitoring mode
as shown in the fig.4.8. The value of Data registers can be changed during on-line monitoring without
stopping the PLC. The status of only internal relays (M) can be changed by force i.e. “Force ON” and
“Force OFF” in the Online monitoring. By clicking mouse right button in the on-line monitoring, it will
show a small window for changing the Force ON/OFF status and data register value. From the main menu
bar <Communication>---<Ladder diagram monitor start> will also start the on-line monitoring.

Fig. On-line Monitoring of Ladder program

This icon will show a window for the monitoring of devices. For example, if you want to monitor
the status of different devices. The double click on the “Device Name”, then a small window will appear
i.e. “Device monitor input” having “Device” and “Device Number” as shown in the fig.4-9. When the
device is ON in ladder software then the “Device status” will be shown in red color on this window. From
Main Menu bar <Communication>---<Device monitor> will go to the device monitor window.

20
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Device Monitoring window

After writing your Ladder program, compile the program for errors. If there are no errors in the
ladder program, then write it to the PLC controller then click to the “Run” button it will bring a small
window for the confirmation of the PLC. Press “Yes” to operate the CPU and it will start functioning. The
same work can be done from main menu bar as well <Communication>--<PLC Run>.

This icon stops the PLC operation and Input/Output will not function. From menu bar
<Communication>--<PLC Stop> will also stop the PLC operation. The “Stop” will also open a small
Window for the confirmation of the PLC to stop.

The code icon will convert your Ladder to Instructions and will check for errors. So, the compiling
process can be performed by this short icon or from main menu bar as <Compile>--<Ladder Diagram
Instruction> will also do the same job.

After writing ladder diagram and compiling it for errors, press this icon for “Writing to PLC” will
open a small window for communication of PC=>PLC as shown in the Fig. In this window, the
“Communication Mode” can set for “Read from PLC”, “Write in PLC” and “PLC<= =>HPP”. In transfer
setup program is transferred to the memory areas used in the ladder.

21
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Loading of the Ladder program

Press this icon for “Reading from PLC” will open a small window for communication of PC<=PLC
as shown in the Fig. In this window, the “Communication Mode” can set for “Read from PLC”, “Write in
PLC” and “PLC<= =>HPP”.

Fig. Uploading of the Ladder program

22
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Quick Guide to Write PLC:

A simple and quick approach to Program a PLC through WPL Software is in the following steps:

STEP#1: Open the WPL Software from “Programs” in “Start” Menu.


STEP#2: Open “New File” or “Old File” from the location through “File” on Menu Bar.
STEP#3: Make Ladder Program in case of a New Program.
STEP#4: Compile the Program for errors from “Complier” Menu.
STEP#5: Load/Write the Ladder to the PLC from “Communication” menu PC<=>PLC or from shortcut
icon bar.
STEP#6: “Run” the PLC and simulate the program.

Important Ladder Programming Tools and their Functions:

The Figure shows some important ladder symbols.

Fig. Ladder Symbols

This is a Normally Open (NO) contact or LD command. By clicking this icon a small window will
appear as shown in the figure below. The window gives some explanation about the “Input Command”
such as that it is an “Open Contact” and “Input Relay” if “X” is selected. The Device Name such as “X”,
“Y”, “T” and “C” etc. and Device Number mean it’s Address i.e. “X0”, “Y0” and “T0” etc. will be given.
The selected device possible range will be shown on the window such as X0~X177. The comments about
the device can be given such as for “X0” write “Start Button” mean that it is a start button. The shortcut for
this command is “F1”.

Fig. The “Device Command” Window for Input Command.

23
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

This is a Normally Close (NC) contact or LDI command and having the same “Device Command”
window given in figure above. But this window will give explanation about the “Close Contact”. The
shortcut for this command is “F2’.

This is a Rising Edge Input contact or LDP command. The same window will appear as shown in
figure above. The shortcut for this command is “F3”.

This is a Falling Edge Input Contact or LDF command. The same window will appear as shown in
figure above. The shortcut for this command is “F4”.

This command is used for the Step Command. Step instruction is a special programming command
used for the ladder programming working in steps. The same window will appear as shown in figure
above. The shortcut is “F5”.

This is used for giving the Application Command such as Input & Output, Timer & Counter, Shift
and Compare commands. The window shown in the figure will appear used for the application command.
The “Function List” will give the list of command. Let us select an “Output Command” then the window
will extended. Select “PLF” from the “Command” then the “API Number” will show “89”. There will be
also “Instruction Hint” which shows the about the instruction. The Device and its Number to which this
command is applicable can be selected from “D” and “Address/Value”. On the bottom of the small window
a small line shows the detail of devices to which this command is applicable are represented by a “*”
symbol. The shortcut for Application Command is “F6”

Fig. The Application Command Window

24
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

This icon is used for the Open Coil Output or OUT command can be also used for this purpose.
The shortcut for the Output Coil is “F7”. By clicking this icon the window shown in the “Device
Command” Figure will appear.

This icon is used for drawing the horizontal line between two devices. The shortcut for the line is
“F8”.

This icon is used for drawing the vertical line between two devices. The shortcut for the line is “F9”.

This is the inverted connection icon. When this is placed between two devices. The behavior of the
output device will change or will invert. The shortcut for invert function is “F11”.

This icon is used for the comparison of the two values. These are the special comparison instructions
as shown in figure below. The shortcut for the comparison command is “F12”.

Fig. Comparison Command Windows

25
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 03

Objective:
Study of Logic Gates in PLC (CLO-2, CLO-3)
OR Gate:

Gate that generates a logic high output in all states except when all inputs are logic low. The function of an
OR gate is simulated in the electric circuit displayed in Figure. the lamp will be ON when one or both
switches are closed.

Figure displays a two-input OR logic gate symbol, its Boolean expression, and its truth table. The truth
table shows a logic high output for all combinations of inputs except where both A and B are low. When
either input A, B, or both are on, the output is on.

Fig. Boolean expression, gate symbol, and truth table for a two-input OR logic gate.

26
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Devices:

Device Function

Program Description:

AND Gate:

Gate that only generates a logic high output when all inputs are logic high. The function of an AND gate is
simulated in the electric circuit displayed in figure. The lamp will be on only when both switches are closed.

Fig. Electric circuit emulating an AND gate

27
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Figure displays a two-input AND logic gate symbol, its Boolean expression, and its truth table. In the truth
table, you can see that there is only one set of inputs that produces a logic high output.

Fig. Boolean expression, gate symbol, and truth table for a two-input AND logic gate.
Ladder Diagram:

Devices:

Device Function

Program Description:

NOT Gate:

Gate that generates a logic high output when all inputs are logic low. The function of a NOT gate is
simulated by the electric circuit displayed in Figure. When the switch is closed, the electric bulb is short
circuited, and it turns off. When the switch is open, electric current flows through the lightbulb, and the
lightbulb turns on. Like the NOT gate, the output is on when the input is off and vice versa. The input is
inverted to generate an output.

28
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Electric circuit emulating the function of a NOT gate.

Figure displays the NOT logic gate symbol, its Boolean expression, and its truth table.

Fig. Boolean expression, gate symbol, and truth table for NOT logic gate.
Ladder Diagram:

Devices:

Device Function

Program Description:

29
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

NOR Gate:

Gate that generates a logic high output when all inputs are logic low. An inverted OR. The function of a
NOR logic gate is simulated in the electric circuit displayed in Figure. The lamp will be ON when both
switches are open. The NOR gate takes its name from NOT and OR. Its outputs are the inverse of the OR
gate.

Fig. Electric circuit emulating a NOR gate.

Figure displays a two-input NOR logic gate symbol, its Boolean expression, and its truth table. Notice the
NOR gate can be built by connecting an OR gate in series with a NOT gate. Using the De-Morgan theorem,
you can convert a NOR gate to an AND gate with inverted inputs where (A + B) ′ = A′ · B′.

Fig. Boolean expression, gate symbol, and truth table for a NOR logic gate.

Ladder Diagram:

30
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

Device Function

Program Description:

NAND Gate:

Gate that does not generate a logic high output when all inputs are logic low. An inverted AND. The
function of a NAND gate is simulated in the electric circuit displayed in Figure. Notice that the lamp will
be off when both switches are closed. The NAND gate takes its name from NOT and AND. Its outputs are
the inverse of the AND gate.

Figure. Electric circuit emulating a NAND gate.

Figure displays a two-input NAND logic gate symbol, its Boolean expression, and its truth table. Notice
that the NAND gate can be built by connecting an AND gate in series with a NOT gate. Using the De-
Morgan theorem, sometimes also called the Bubble method, you can convert a NAND gate to an OR gate
with inverted inputs where (A · B) ′ = A′ + B′.

31
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Figure. Boolean expression, gate symbol, and truth table for a NAND logic gate.

Ladder Diagram:

Devices:

Device Function

Program Description:

32
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

XOR Gate:

Gate that generates a logic high output when one input is logic high and the other input is logic low or vice
versa. The function of an XOR (exclusive OR) gate is simulated in the electric circuit displayed in Figure.
The lamp will be on if one switch is open while the other switch is closed.

Figure. Electric circuit emulating an XOR gate.

Figure displays an XOR logic gate symbol, its Boolean expression, and its truth table. Looking at the truth
table, you can see that either inputs A or B (but not both) must be high to produce a high output. One input
must be ON and the other one OFF in order to have the output ON.

Fig. Boolean expression, gate symbol, and truth table for an XOR logic gate.

Ladder Diagram:

33
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

Device Function

Program Description:

XNOR gate:

Gate that generates a logic high output when either both inputs are logic high or both inputs are logic low.
The function of an XNOR (exclusive NOR) gate is simulated in the electric circuit displayed in Figure. The
lamp will be on when either both switches are open or closed. The lamp will not be on if only switch A is
activated, or if only switch B is activated.

Fig. Electric circuit emulating an XNOR gate.

34
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Figure displays an XNOR logic gate symbol, its Boolean expression, and its truth table. Notice the XNOR
gate can be built by connecting an XOR gate in series with the NOT gate. When either or both pushbuttons
are pressed or not pressed, the output is ON.

Fig. Boolean expression, gate symbol, and truth table for an XNOR logic gate.

Ladder Diagram:

Devices:

Device Function

Program Description:

35
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 04

Objective:
Study of Timers in PLC (CLO-2, CLO-3)
Timers in PLC Trainer:

Timers are used to provide timings to control an event or to provide delay.

Instruction Sheet:

Relay (Bit Mode)

DEVICE ITEM USAGE RANGE FUNCTION

Register (WORD data)

Timer Syntax:

Explanations:

When TMR instruction is executed, the designated coil of the timer will be On and the timer will start to
time. When the set value in the timer is reached (present ≥ set value), the contact will be:

36
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Types of Timers:

There are two types of timers.

1. On-Delay Timers:

Timer which turns output “on” after a preset time when it is energized.
Timing Diagram:

Example:

To get a TMR of 3 seconds, you can use any of the Timers described above as follows:

• TMR0-TMR63 (100ms x K30 = 3sec)


• TMR64-TMR126 (10msec x K300 =3sec), Enabling M1028 bit ON.
• TMR127 (1ms x K3000 =3sec)
Ladder Diagram:

Control Purpose:
Enabling the indicator to be ON after a 3 second delay and OFF immediately by the switch.

37
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

X37 Input to timer T0


T0 100 ms timer (NO), Time base=100ms
Y0 Output of counter

Program Description:

• When X37 = ON, TMR instruction will be executed. Timer T0 will be ON and start counting for 3
sec. When T0 reaches its st value, the NO (Normally open contact) T0 will be activated and
indicator Y0 will be ON.
• When X0 is OFF, TMR instruction will not be executed. Timer T0 will be OFF and so will NO
contact T0. Therefore, indicator Y0 will be OFF.

2. Off-Delay Timers:
Timer which turns output “off” after a preset time when timer has lost power.

Timing Diagram:

Example:

To get a TMR of 5 seconds, you can use any of the Timers described above as follows:

• TMR0-TMR63 (100ms x K50 = 5sec)


• TMR64-TMR126 (10msec x K500 =sec), Enabling M1028 bit ON.
• TMR127 (1ms x K5000 =5sec)
Ladder Diagram:

Control Purpose:
Enabling the indicator ON immediately and OFF after 5 sec delay by the switch.

38
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

X37 Input to Y0 and Timer T0)


T0 5 sec timer, Time base= 100ms
Y0 Output Indicator

Program Description:

• X37= ON when the switch turned on. Normally closed contact X37will be activated, and TMR
instruction will not be executed. Coil T0 will be OFF and so will the NC contact T0. Because X37
=ON, the indicator Y0 will be ON and latched.
• X37=OFF when the switch is turned off. The Normally closed contact X37 will not be activated,
which makes TMR instruction executed. Indicator Y1 will be ON by the latched circuit until T0
reaches its set value.
• When timer T1 reaches its set value of 5 seconds, coil T1 will be ON. The NC contact T0 will be
activated, which makes the indicator y0 OFF.
Exercise # 1:

On-Off cycle timer

Figure below shows how on-delay timers can be used to produce an on-off cycle timer. The
timer is designed to switch on an output for 5s, then off for 5s, repeating this cycle.

Timing Diagram:

39
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Devices:

Program Description:

Exercise # 2:

Design a ladder logic program that could be used to flash a LED on and off at 2Hz. Use switch 1 to start
flashing sequence. The flashing sequence should only occur as long as switch 1 is on.

Ladder Diagram:

40
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Timing Diagram:

Devices:

Program Description:

Exercise No 3:

Program an automatic control for the system shown in Figure.


When the ON button is pushed, a stacker starts stacking plywood sheets at position A manually.
Plywood sheets are counted by PLC counter function. When 5 parts are stacked, the conveyor goes
on and moves the stack to position B. A sensor is used to stop the conveyor at B. At B, paint (P)
is applied for 12.5 seconds. After painting is complete, the conveyor is restarted and moves parts
to position C. At position C the stack stops automatically, and the stack is removed manually. The
stop button stops the process any time it is depressed. Add limit switches and other devices as
required.

41
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Devices:

42
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Program Description:

43
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 05

Objective:
Study of counters in PLC (CLO-2, CLO-3)
Counters in PLC Trainer:

A set of PLC instructions that counts, calculates, or keeps a record of the number of times something
happens. Counter instructions are internal to PLC. Counters simply count and store the number of events
that occurs.

Instruction Sheet:

Relay (Bit Mode)

DEVICE ITEM USAGE RANGE FUNCTION

Register (WORD data)

Counter Syntax:

Explanations:

When the CNT instruction goes from Off to On, the designated counter coil will be driven, and the present
value in the counter will plus 1. When the counting reaches the set value (present value = set value), the
contact will be:

44
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram for General Counters

Devices

X0 Input to counter
C0 General purpose counter
Y0 Output of counter

Program Description:

Ladder Diagram for Retentive Counters

Devices:

X0 INPUT
Y0 OUTPUT
C115 Retentive Counter 114~127
Y1 Output of Counter

Program Description:

45
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Exercise # 1:

An indicating light is to go on when a count reaches 5. The light is then to go off when a count of
8 is reached.

Ladder Diagram:

Devices:

Device Function

Program Description:

Exercise # 2:

A machine, M, is to be turned on either when count A goes up to 7 or when count B goes up to


10. One stop button or switch resets the entire process.

46
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Devices:

Device Function

Program Description:

Exercise # 3:

Once the photoelectric sensor detects 10 products, the robotic arm will begin to pack up. When the action
is completed, the robotic arm and the counter will be reset.

47
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Devices:

Device Function

Program Description:

48
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Exercise # 4:

A bottling process for 12 bottles operates as follows:


Bottles are counted until all 12 are in position for filling. When in position in the carton, the 12 bottles are
filled simultaneously for 5 seconds. After filling, there is a pause of 3 seconds for foam to subside. The 12
caps are then put on and counted as they are installed. A solenoid then pushes the completed carton of 12
on a conveyor. The system is reset for a new group (to be restarted manually) of 12 bottles by a limit switch
that indicates that the carton is out of the “fill” position and on the conveyor.

Ladder Diagram:

Devices:

Device Function

49
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Program Description:

50
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 06

Objective:
To develop a program for Latching, Direct Online starter, Interlocking, Motor
Reverse and Forward, Star-Delta starter in PLC. (CLO-2, CLO-3)

Latched circuit and SET/ RESET instructions

(A momentary switch) The latching instructions let us use momentary switches and program the plc so that
when we push one the output turns on and when we push another the output turns off. This would be the
function of a latching instruction. The latch instruction is often called a SET.

Control Purpose:

• Turn on the switch, the light will be ON; turn off the switch, the light will be OFF.

Devices:

Device Function
X0 Switch-ON button, X0 will be ON when pressed
X1 Switch-OFF button, X1 will be ON when pressed
Y0 Output Indicator

Latched Circuit

Latched Circuit for SET/RST Instructions

51
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Program Description:

• In the above programs, when X0 goes from OFF to ON, Y0 will stay in ON state. When X1 goes
from OFF to ON, Y0 will stay in OFF state.

• When X0 and X1 enables at the same time, it will “stop first”, that is, Y0 and the indicator will be
OFF.

Direct-On-Line (DOL) starter:

One method of starting electric motors is using direct on line (DOL). 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.

Control Wiring Diagram of DOL Starter

The starter can be containing 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.

Ladder Diagram:

52
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

Device Function

Program Description:

Interlocking

To interconnect the output circuit in such a way, in which the second output will not start until the first one
run. This kind of output circuit connection is called interlocking.

Interlock Circuit:

53
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Control Purpose:

• The Entry/Exit of the parking lot is a single lane passage. By controlling the indicators, the program
ensures that only one car can pass through the Entry/Exit so as to prevent car accident between
entering and leaving cars
Devices:

Device Function
X0 Car entering sensor. When a car passes through the sensor, X0 =ON.
X1 Car leaving sensor. When a car passes through the sensor, X1 =ON.
Y0 Entering car indicator (ON means “GO”, OFF means “STOP”)
Y1 Main Contactor coil of motor (ON means “GO”, OFF means “STOP”)

Ladder Diagram:

Program Description:

54
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Motor Reverse and Forward Control:

The interlock contacts installed in the previous section work fine, but the output will run only as long as
each push button switch is held down. If we wanted to keep the motor running even after the operator takes
his or her hand off the control switch(es), so change the circuit in a couple of different ways:

• replace the push button switches with toggle switches, or


• add some more relay logic to “latch” the control circuit with a single, momentary actuation of either
switch.

Let’s see how the approach is implemented since it is commonly used in industry:

55
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

When the “Forward” pushbutton is actuated, Y0 will energize, closing the normally-open auxiliary contact
in parallel with that switch. When the pushbutton is released, the closed Y0 auxiliary contact will maintain
current to the coil of Y0, thus latching the “Forward” circuit in the “on” state. The same sort of thing will
happen when the “Reverse” pushbutton is pressed.

Devices:
Device Function

Ladder Diagram:

Motor Reverse and Forward Control using Timer:


If the motor has been running in the forward direction, both Y0 and Timer1 instruction will have been
energized. This being the case, the normally-closed, timed-closed contact of T1 will have immediately
opened the moment Timer1 instruction was energized. When the stop button is pressed, contact T1 waits
for the specified amount of time before returning to its normally-closed state, thus holding the reverse
pushbutton circuit open for the duration so Y1 can’t be energized. When Timer1 times out, the contact
will close, and the circuit will allow Y1 to be energized if the reverse pushbutton is pressed. In like
manner, Timer2 will prevent the “Forward” pushbutton from energizing Y0 until the prescribed time
delay after Y1 (and Timer2) have been de-energized.

56
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices
Device Function

Ladder Diagram:

57
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Star-Delta Starter:
Star-Delta connection is a type of starting method of 3 phase AC Induction Motor. Normally Starter is used
for smooth starting of a motor. Star-Delta starter starts motor by reducing the initial current. Initially
the motor is connected to star connection. After a time, the motor is connected to delta connection.

Control Wiring of Star-Delta Starter

Devices:
Device Function

58
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Program Description:

59
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 07

Objective:
To study Data Handling (Move, Compare and Arithmetic) instructions in PLC.
(CLO-2, CLO-3)

Data Handling:

Timers, counters, and individual internal relays are all concerned with the handling of individual bits, that
is, single on/off signals.
PLC operations involving blocks of data representing a value; such blocks are called Words. A block of
data is needed if we are to represent numbers rather than just a single on/off input.
Data handling consists of operations involving moving or transferring numeric information stored in one
memory word location to another word in a different location, comparing data values, and carrying out
simple arithmetic operations.
For example:
there might be the need to compare a numeric value with a set value and initiate action if the actual value
is less than the set value.

Data Register:

Each Data Register in Delta PLC can store a Binary Word of 16 bits.

Registers in Delta PLC (WORD Data):

Move Instruction:

For moving data from one location or register to another.

Operands: S: Source of data D: Destination of data

60
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Explanations:

1. If S and D are used in device F, only 16-bit instruction is applicable.


2. See the specifications of each model for their range of use.
3. When this instruction is executed, the content of S will be moved directly to D. When this
instruction is not executed; the content of D remains unchanged.

Program Example:

MOV instruction has to be adopted in the moving of 16-bit data.


• When X0 = Off, the content in D20 will remain unchanged. If X0 = On, the value Kxx will be
moved to D20 data register.
• When X1 = Off, the content in D400 will remain unchanged. If X1 = On, the value Kxx will be
moved to D400 data register and so on.

Arithmetic Instructions:

Arithmetic instructions can be used to design to add, Subtract, Multiply and Divide two registers.

ADD D0 D1 D2

D0 Source Register (Can be decimal Value)

D1 Source Register

D2 Destination Register

Operation:
The data contained within source devices (D0, D1) is combined and the total is stored at the specific
destination (D2).

All calculations are algebraically processed, i.e. 5 + (-8) = -3.

61
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

• Write ‘add’ in the dialogue box of input instruction.


• Click on the … left to the ok.

• Another dialogue box will open where you will select the source and the destination registers
Subtract:

SUB D0 D1 D2

D0 Source Register (Can be decimal Value)

D1 Source Register

D2 Destination Register

Operation:
The data contained within the source device, D1 is subtracted from the contents of source device D0. The
result or remainder of this calculation is stored in the destination device D2.

All calculations are algebraically processed, i.e. 5 - (+8) = -3.

• Write ‘sub’ in the dialogue box of input instruction.


• Click on the … left to the ok.
• Another dialogue box will open where you will select the source and the destination registers.
Multiplication:

MUL K D0 D1

62
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

D0 Source Register (Can be decimal Value)

D1 Source Register

D2 Destination Register

Operation:
The contents of the two source devices (D0, D1) are multiplied together and the result is stored at the
destination device (D2).

Normal rules of algebra apply.

Program Description

This command is used to multiply two registers; we can also use it to multiply a decimal value with any
register value.

• Write ‘mul’ in the dialogue box of input instruction.

• Click on the … left to the ok.


Another dialogue box will open where you will select the source and the destination registers.
Division:

DIV D0 D1 D2

D0 Source Register (Can be decimal Value)

D1 Source Register

D2 Destination Register

63
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Operation
The primary source (D0) is divided by secondary source (D1). The result is stored in the destination (D2).
The normal rules of algebra apply.
Program Description

This command is used to divide two registers, we can also use it to divide a decimal value with any
register value.

• Write ‘div’ in the dialogue box of input instruction.

• Click on the … left to the ok.

• Another dialogue box will open where you will select the source and the destination registers
Compare Instruction:

Operands:

S1: Comparison Value 1 S2: Comparison Value 2 D: Comparison result

Program Example:

64
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Program Description:

Program Example for Data Handling:

Program Description:

65
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 08

Objective:
To study Conditional Jump, Pulse Width Modulation, Master Control Set and
Reset Instructions in PLC (CLO-2, CLO-3)
Conditional Jump

Used to skip the ladder rung by calling the Pointer.

Operands:

S: The destination pointer (P) of conditional jump

Explanation:

When the user does not wish a particular part of PLC program, CJ instruction can be adopted.

Program Example:

• When X25 is FALSE, program will behave normally.


• When X25 is TRUE, the ladder rung 6 will not be scanned by PLC.

Command Syntax: CJ

Exercise:

Device a ladder program to skip the punching by Y0 if the object is bigger. Use Conditional Jump
command to skip the punching operation.

66
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Program:

Program Description:

67
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Pulse Width Modulation :

PWM is used to generate train of Pulses.

Operands:

S1: Pulse output width S2: Pulse output period D: Pulse output device (only be specified as Y1)

Explanations:

1. S1 ≤ S2.
2. See the specifications of each model for their range of use.
3. In SS series MPU, PWM instruction can only be used once in the program.
4. Flags: See remarks for more details.
5. Range of S1: (t) 0 ~ 32,767ms.
6. Range of S2: (T) 1 ~ 32,767ms (but S1 ≤ S2).
7. D for SS series MPU: (only be specified as Y1)
8. PWM instruction designates the pulse output width in S1 and pulse output period in S2 and outputs
from output device D.

Program Example:

1. When X1 gets ON, Y1 will generate pulses with the ON time = 1 seconds and OFF time = 0.5 sec.
In other words, duty cycle is 50% and cycle time is 1.5 seconds
𝑃𝑊
2. Duty Cycle, D =
𝑇

Timing Diagram:

68
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Exercise:

Generate the train of 500 pulses for Y1. (On time 1 second and Cycle time 1.5 seconds)

Ladder Program:

Program Description:

• When X0 gets ON, Y1 will generate pulses with the ON time = 1 seconds and OFF time = 0.5
sec.
• In ladder 9, the falling edge of Y1 will increment D0 every time when the pulse falling edge
comes. When the number of pulses is equivalent to 15, M1 gets TRUE and stops the train of
pulses.
• In ladder 25, falling edge of X0 is used to reset the D0

Master Control Set and Reset

Master Control used to enable and disable the Zone of ladders

Explanations:

69
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

1. MC is the main-control start instruction. When the MC instruction is executed, the execution of
instructions between MC and MCR will not be interrupted. When MC instruction is OFF, the motion
of the instructions that between MC and MCR is described as follows:

Timer The counting value is set back to zero, the coil and the contact are both
turned OFF
Accumulative timer The coil is OFF, and the timer value and the contact stay at their present
condition
Counter The coil is OFF, and the counting value and the contact stay at their
present condition
Coils driven up by the All turned OFF
OUT instruction
Devices driven up by Stay at present condition
the SET and RST
instructions
Application All of them are not acted
instructions
2. MCR is the main-control ending instruction that is placed at the end of the main-control program and
there should not be any contact instructions prior to the MCR instruction.

Program Example:

• If X27 is TRUE, the zone from ladder 4 to ladder 14 will be enable and instruction will work as
per the logic.
• If X27 is FALSE, the zone from ladder 4 to ladder 14 will be disabled and all OUT bits will get
FALSE but the SET bit will retain its state.

70
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Exercise:

There are 3 groups participating in the quiz game: pupils, high school students and professors. If they want
to get the chance of answering the question from the host, they must press the answer button on their table
first. Other groups’ pressing will be invalid if any group gets the chance successfully
• There are 2 answer buttons for the pupil group and professor group and 1 answer button for the
high school student group. In order to give preferential treatment to the pupil group, Y0 will be ON
if any one of X0 or X1 is pressed. However, in order to limit the professor group, Y2 will be ON
when X3 and X4 are pressed at the same time. For the high school student group, Y1 will be ON
when X2 is pressed.
• If the host presses X5 (Reset NC button), Y0, Y1 and Y2 will be OFF.

Devices:

Device Function

71
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Ladder Diagram:

Program Description:

72
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Experiment # 08

Objective:
To study Analog Input and Digital Output in PLC (CLO-2, CLO-3)
Analog Input Signals

Analog input modules are used in applications where the field device’s signal is continuous as shown in
figure. Unlike discrete signals, which possess only two states (ON and OFF), analog signals have an infinite
number of states.

Example:

Temperature is an analog signal because it continuously changes by infinitesimal amounts. Consequently,


a change from 70°F to 71°F is not just one change of 1°F, but rather an infinite number of smaller changes
of a fraction of a degree.

Fig. Representation of a continuous analog signal.

PLCs are discrete systems that only understand 1s and 0s. Therefore, they cannot interpret analog signals
in their continuous form. Analog input interfaces translate continuous analog signals into discrete values
that can be interpreted by PLC processors. These discrete values are subsequently used in the control
program. Table lists some devices that are typically interfaced with analog input modules.

Table. Devices used with analog input interfaces.

73
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Instructions for Analog Input Modules:

Analog input modules digitize analog input signals, thereby bringing analog information into the PLC as
shown in the figure. The modules store this multibit information in register locations inside the PLC.

Fig. Digitization of an analog signal.

Figure below illustrates the sequence of events that occurs while reading an analog input signal.
The module transforms the analog signal, through an analog-to-digital converter (A/D), into 12
bits of digital information that will be stored in register 1000 after the instruction is executed. After
the PLC reads this information, the control program can reference the register address for
comparisons, arithmetic calculations, etc. The analog value stored in the register will be in either
BCD or binary format.

Fig. Steps in converting an analog signal to binary format.


Example:

The contents of register 1000 be after the multibit instruction shown in Figure below is executed. After the
instruction is executed, the contents of register 1000 will be: 0000 1010 1100 1111

74
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Multibit instruction.

This number corresponds to the digitized value generated by the module. Since the value is represented in
12 bits, the preceding bits are filled with 0s. Note that the value stored in register 1000 is in binary. Its
decimal equivalent, for computational purposes, is 2767.

Analog Input Data Representation:

Field devices that provide an analog output as their signal (analog sensors or transducers) are usually
connected to transmitters, which in turn, send the analog signal to the module. A transducer converts a
field device’s variable (i.e., pressure, temperature, etc.) into a very low-level electrical signal (current or
voltage) that can be amplified by a transmitter and then input into the analog interface as shown in figure.

75
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Due to the many types of transducers available, analog input modules have several standard electrical input
ratings. Table 7-2 lists the standard current and voltage ratings for analog interfaces. Note that analog
interfaces can be either unipolar (positive voltage only—i.e., 0 to +5 VDC) or bipolar (negative and positive
voltages—i.e., –5 to +5 VDC).

Table. Typical analog input interface ratings.

An analog input module transforms an analog input signal via a sensor/transmitter unit into a discrete value
that is readily understandable by man and machine as shown in Figure. This transformed value is the digital
equivalent of the variable analog signal (e.g., pressure in psi).

Fig. Transformation of an analog signal into a binary or BCD value.

Resolution:
An analog-to-digital converter (A/D or ADC) performs the signal conversion in an analog input
module. The converter divides, or digitizes, the input signal into many digital counts, which
represent the magnitude of the current or voltage. This division of the input signal is called
resolution. The resolution of the module indicates how many parts the module’s A/D will divide
the input signal into; it is given as a function of how many bits the A/D uses during conversion.

For example:
If an A/D breaks down an input signal using 12 bits or 4096 parts (i.e., 212 = 4096) as shown in
Figure 7-8, it has a 12-bit resolution (i.e., a 12-bit binary number with a value ranging from 0000

76
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

to 4095 decimal will represent the signal). In this case, the manufacturer could then use the
remaining bits (bits 14–17) as status monitoring bits, representing module conditions such as
active, OK, channel operating, etc. An A/D converter transfers its digital-equivalent values to the
processor, which in turn, makes them available for use in register or word locations.

Fig. An analog-to-digital converter with 12-bit resolution.

Analog Input Data Handling:

During the control of the process, a signal variable is measured by a sensor and passed to the input module.
The module transforms the signal into discrete value according to the resolution of the A/D convertor.

Delta PLC Analog module provide four input channels per interface. Therefore, they can connect to several
input signals.

Example:

As shown in the figure below, the discrete value is placed in a holding register inside the module which
will transfer the value once the appropriate instruction is executed during the program scan evaluation of
the ladder control program. The Instruction will transfer the numeric analog value into a register specified
by user in the analog input instruction used. This value is stored in the data table under a word location or
register storage location defined by the instruction.

77
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Fig. Process for inputting analog data to a word location.

Delta DVP-06XA Module:

Delta (DVP -06XA) Mixed A/D to D/A Module


No of Analog Input Channels 4
No of Analog Output Channels 2
Specifications Voltage Input Current Input
Analog Input Range ± 10𝑉 ± 20𝑚𝐴
Digital Data Range ± 2000 ± 1000
Resolution 12 bits (1 LSB = 5mV) 11 bits (1LSB= 20µA)
FROM To read from analog input module.
TO To write to analog output module.

Auxiliary Setup for Extension Module:

• Select Auxiliary setup for Extension module.

78
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

• Select analog input module, check the selection box.

• Click on setup a new menu shall open like this.

• Select Channel input present value, this provides you with selection that which input channel you
want to use for giving input to PLC.
• Check selection box of “Read Register.”
• Click on Preview, then click “Add to list” to generate program codes..
• Click ok.

79
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Exercise:

Control the temperature using comparison instructions in PLC where outputs are energized until the setpoint
is reached.

The heater turns on when the temperature falls to or below 597 degrees and turns off when the temperature
reaches 603 degrees or more. Compare for both source values for high and low temperature to control the
heater.

Ladder Diagram:

80
Department of Electronics Engineering UET Taxila, Sub-Campus Chakwal
Industrial Electronics Lab Manual (EE-422A)

Devices:

Device Function

Program Description:

81

You might also like