IA Module4 Rev21
IA Module4 Rev21
INDUSTRIAL AUTOMATION
COURSE CODE: 5042 (REV 2021)
PROGRAMMABLE LOGIC CONTROLLER
MODULE IV NOTES
1
Industrial Automation – Module IV
Architecture of PLC
2
Industrial Automation – Module IV
3
Industrial Automation – Module IV
6. Peripheral devices
They are divided into several categories like programming aids, operational aids, I/O
enhancements and computer interface devices.
Programming aids provide documentation and program recording capabilities- can be done
using PC compatible software.
Operational aids include variety of resources like color graphics CRTs or other equipment
which can be used to monitor specific process variables
I/O enhancement group are special hardware modules that can be plugged into the PLC, which
provides intelligence and remote I/O capabilities.
Computer interface group provides PLC to PLC communication or network interaction with
various computer systems.
4
Industrial Automation – Module IV
Advantages of PLCs
1. Ease of programming and reprogramming in the plant
2. A programming language that is based on relay wiring symbols familiar to most plant
electric personnel.
3. High reliability and minimum maintenance
4. Ability to communicate with computer systems in the plant
5. Moderate to low initial investment cost
6. Rugged construction
7. Modular design
Applications of PLCs
1. They are used in glass manufacturing, for controlling the material ratio
2. They are used to control machines used for paper manufacturing
3. They are used to mix raw materials in the correct quantity, in cement manufacturing industry
4. They are used to control the wind turbines
5. They are used in boilers in thermal power plants
6. In process automation plants (mining, oil and gas)
5
Industrial Automation – Module IV
6
Industrial Automation – Module IV
• Comments –Comments are displayed at the start of each rung and are used to describe the
logical expressions and control operations that the rung, or groups of rungs, are executing.
Understanding ladder diagrams is made a lot easier by using comments.
• Electrical devices are shown in their normal condition. Thus a switch, which is normally
open until some object closes it, is shown as open on the ladder diagram. A switch that is
normally closed is shown closed.
• A particular device can appear in more than one rung of a ladder. The same letters and/or
numbers are used to label the device in each situation.
• The inputs and outputs are all identified by their addresses, the notation used depending on
the PLC manufacturer. This is the address of the input or output in the memory of the PLC.
• When the PLC is in its run mode, it goes through the entire ladder program to the end, the
end rung of the program being clearly denoted, and then promptly resumes at the start.
7
Industrial Automation – Module IV
Examples
Ladder logic to switch a bulb ON/OFF
In the ladder logic diagram we can see there is an input contact (N-O) “I0.0” which is a toggle
switch in the physical connections to the plc. There is also an output coil addressed as “Q0.0” which
can be a Motor, Bulb or any signaling device in the physical connection.
2. AND GATE
In AND Gate, when both inputs (I1 and I2) are high then the output (Q1) will be high. For all other
inputs, output (Q1) will be the low.
8
Industrial Automation – Module IV
3. OR GATE
Working: If both inputs are low in the OR gate, then the output will be low. For all other cases, the
output will be high.
In case both or anyone inputs (I1 and I2) are closed then coil (Q1) will on.
4. NAND GATE
NAND gate is operated as an AND gate and followed by the inverter. In NAND Gate, the output
will be low when both inputs are high. For all other
cases, the output will be high.
𝑄1 = ¯¯
𝐼1 .̄¯𝐼¯2¯ = 𝐼¯1 + 𝐼¯2
If both switches (I1 and I2) or anyone switch (I1 or I2) are closed, the lamp will be glow. In the
case, both switches are open then the lamp will not be glow.
5. NOR GATE
NOR Gate is operated OR Gate followed by the NOT
Gate. When both inputs are low then the output will be
high.
The Coil (Q1) will be activated if both inputs are closed. Coil (Q1) will be deactivated if any one
or both the inputs are open.
𝑄1 = ¯𝐼1¯¯+̄¯¯𝐼¯2¯ = 𝐼¯1 . 𝐼¯2
9
Industrial Automation – Module IV
6. EX-OR GATE
Working: If both inputs are same, the output will become low. For any other input condition, the
output will be high.
𝑄1 = 𝐼1 𝐼¯2 + 𝐼¯1 𝐼2
7. EX-NOR GATE
Working: When both inputs (I1 and I2) are same then the output will high.
𝑄1 = 𝐼¯1 𝐼¯2 + 𝐼1 𝐼2
10
Industrial Automation – Module IV
Half-Adder
A half adder can add two binary bits A and B. It has two outputs. One is sum and the other is carry.
The expression for sum is same as the EXOR gate expression and that of carry is same as AND
gate. The expressions are as given:
𝑆 = 𝐴̅𝐵 + 𝐴𝐵
¯
𝐶 = 𝐴𝐵
Half subtractor
This circuit is used to subtract one binary bit from another. There are two inputs A and B
and there are two outputs. One output is the difference and the other one is borrow. The expressions
are as given:
𝐷 = 𝐴̅𝐵 + 𝐴𝐵
¯
𝐵o = 𝐴̅𝐵
11
Industrial Automation – Module IV
ADD:
SUB:
SUB block is used to do the Subtraction of the two values
stored in source A and source B and store the output in
destination address. Value stored in N7:1 is subtracted from
the value stored in N7:0 and result is stored in N7:3.
12
Industrial Automation – Module IV
MUL:
DIV:
DIV block is used to do the Division of the two values stored in
source A and source B and store the output in destination address.
Value stored in N7:0 is divided by the value stored in N7:1 and result
is stored in the destination address.
SQR
SQR block is used to find the square root of the value stored
in source address and results the value in destination address.
The number whose square root is to be found is to be stored
in N7:0. The result of operation will be available at the
destination address N7:1.
NEQ:
NEQ block is used to negate the value stored in source
address and results the value in destination. The value
which is to be negated can be stored in N7:0. Result will be
available at the destination address N7:1.
13
Industrial Automation – Module IV
14
Industrial Automation – Module IV
The GEQ instruction can be used to test whether one value (source
A) is greater than or equal to another (source B).
If the value at source A is greater than or equal to the value at source
B, the instruction is logically true.
15
Industrial Automation – Module IV
The LIM instruction can be used to test for values within or outside a
specified range, depending on how you set the limits.
16
Industrial Automation – Module IV
17
Industrial Automation – Module IV
Down counter
18
Industrial Automation – Module IV
This input instruction is the target of JMP instructions having the same label number. This
instruction must be programmed as the first instruction of a rung. You can program multiple jumps
to the same label by assigning the same label number to multiple JMP instructions. However, label
numbers must be unique. Do not jump (JMP) into an MCR zone.
19
Industrial Automation – Module IV
SBR Instruction
Use a subroutine to store recurring sections of program logic that must be executed from
several points within your application program. A subroutine saves memory because you program
it only once.
Update critical I/O within subroutines using immediate input and/or output instructions
(IIM, IOM), especially if your application calls for relatively long subroutines. Otherwise, the
controller does not update I/O until it reaches the end of the main program (after executing all
subroutines).
Master Control Reset (MCR)
MCR zones let you enable or disable segments of the program.
When you program MCR instructions, note that:
• You must end the zone with an unconditional MCR instruction.
• You cannot nest one MCR zone within another.
• Do not jump into an MCR zone. If the zone is false, jumping into it activates the zone.
• Always place the MCR instruction as the last instruction in a rung.
Do not jump (JMP) into an MCR zone.
• Instructions that are programmed within the MCR zone starting at the LBL instruction and
ending at the ‘END MCR’ instruction are always evaluated as though the MCR zone is true,
regardless of the true state of the “Start MCR” instruction. If the zone is false, jumping into it
activates the zone from the LBL to the end of the zone.
Temporary End (TND) Instruction
The TND instruction, when its rung is true:
• Stops the processor from scanning the rest of the program file
• Updates the I/O, and
• Resumes scanning at rung 0 of the main program
If this instruction’s rung is false, the processor continues the scan until the next TND instruction
or the END statement. Use this instruction to progressively debug a program, or conditionally omit
the balance of your current program file or subroutines
Suspend (SUS) Instruction
When the SUS instruction is executed, it causes the processor to enter the Suspend Idle mode and
stores the Suspend ID in the status file.
All outputs are de-energized. The SUS instruction can be
used to trap and identify specific conditions for program
debugging.
20
Industrial Automation – Module IV
Move Instructions
Move (MOV) Instruction
This instruction moves the source value to the destination location. As long as the rung remains
true, the instruction moves the data on each scan.
Entering Parameters
Source is the address of the data you want to move.
Mask is the address of the mask through which the instruction moves data; the mask can be a
hexadecimal value (constant).
Destination is the address where the instruction moves the data.
21
Industrial Automation – Module IV
22
Industrial Automation – Module IV
23