PLC - Logic Gates
PLC - Logic Gates
PLC - Logic Gates
Mechatronics
Experiment No: 4
Aim: Ladder Diagram simulation, using suitable software, for logic gates
Introduction-
A Programmable Logic Controller (PLC) is a specialized computer like device used to replace
banks of electromagnetic relays in industrial process control. The PLC is also known as a
programmable controller (PC). The tile "PC" for programmable controller could be confused
in common usage with "PC" used to mean personal computer. To avoid this confusion, we shall
refer to the programmable controller as a programmable logic controller or PLC.
The programmable logic controller as a heavy-duty computer system designed for machine
control. Like a general-purpose computer, the PLC is based on digital logic and can be
fieldprogrammed. The programming language is a bit different because the purpose of the PLC
is to control machines. The PLC is used to time and sequence functions that might be required
in assembly lines, robots, and chemical processing. It is designed to deal with the harsh
conditions of the industrial environment. Some of the physical environment problems could
include vibration and shock, dirt and vapors, and temperature extremes. The PLC commonly
has to interface with a wide variety of both input and output devices. Some input devices
include limit and pressure switches, temperature and optical sensors, and analog- to digital
converters (ADCs). Some output devices valves, motors and cylinders, and Digital-to-Analog
converts (DAC).
Before the advent of solid-state logic circuits, logical control systems were designed and built
exclusively around electromechanical relays. Relays are far from obsolete in modern design,
but have been replaced in many of their former roles as logic-level control devices, relegated
most often to those applications demanding high current and/or high voltage switching.
Systems and processes requiring "on/off" control abound in modern commerce and industry,
but such control systems are rarely built from either electromechanical relays or discrete logic
gates. Instead, digital computers fill the need, which may be programmed to do a variety of
logical functions.
In the late 1960s an American company named Bedford Associates released a computing
device they called the MODICON. As an acronym, it meant Modular Digital Controller, and
later became the name of a company division devoted to the design, manufacture, and sale of
these special-purpose control computers. Other engineering firms developed their own versions
of this device, and it eventually came to be known in non-proprietary terms as a PLC, or
Programmable Logic Controller.
The purpose of a PLC was to directly replace electromechanical relays as logic elements,
substituting instead a solid-state digital computer with a stored program, able to emulate the
interconnection of many relays to perform certain logical tasks.
The diagram shows Power Supply, I/O, central processor, memory, and programming and
peripheral device subsections. Each is discussed below.
1. Input System:
Inputs are defined as real-world signals giving the controller real-time status of process
variables. These signals can be analog or digital, low or high frequency, maintained or
momentary. Typically they are presented to the programmable controller as a varying voltage
current or resistance value. Signals from thermocouples (TCs) and resistance temperature
detectors (RTDs) are common examples of analog signals. Some flow meters and strain gauges
provide variable frequency signals, while pushbuttons, limit switches, or even
electromechanically relay contacts are familiar examples of digital, contact closure type
signals. One additional type of input signal, the register input, reflects the computer nature of
the programmable controller.
Inputs are devices that supply a signal/data to a PLC. Typical examples of inputs are push
buttons, switches, and measurement devices.
A discrete input also referred to as a digital input, is an input that is either in an ON or OFF
condition. Pushbuttons, toggle switches, limit switches, proximity switches, and contact
closures are examples of discrete sensors which are connected to the PLC discrete or digital
inputs. In the ON condition, a discrete input may be referred to as logic 1 or logic high. In the
OFF condition, a discrete input may be referred to as logic 0 or a logic low.
2. Outputs:
There are three common categories of outputs: Discrete, Register, and Analog. Discrete outputs
can be pilot lights, solenoid valves, or lamp box. Register output can drive panel meters or
displays; analog output scan drive signals to variable speed drives or to I/P (current to air)
converters and thus to control valves.
Outputs are devices that await a signal/data from the PLC to perform their control functions.
Lights, horns, motors, and valves are all good examples of output devices.
4. Memory Unit:
The memory unit of the PLC serves several functions. It is the library where the application
program is stored. It is also where the PLC's executive is stored. An executive program
functions as the operating system of the PLC. It is the program that interprets, manages, and
executes the user's application program.
Finally, the memory unit is the part of the programmable controller where process data from
the input modules and control data for the output modules are temporarily stored as data tables.
Typically, an image of these data tables is used by the CPU and, when appropriate, sent to the
output modules.
Memory can be volatile or nonvolatile. Volatile memory is erased if power is removed.
Obviously, this is undesirable, and most units with volatile memory provide battery back up to
ensure that there will be no loss of program in the event of a power outage. Nonvolatile memory
does not change state on loss of power and is used in cases in which extended power outages
or long transportation time to the job site (after program entry) are anticipated. The basic
programmable controller memory element is the word. A word is a collection of 4, 8, 16, or 32
bits that are used to transfer data about the programmable controller. As word length increase
more information can be stored in a memory location.
5. Programmer Units:
The programmer unit provides an interface between the PLC and the user During Program
development, start-up, and troubleshooting. The instruction to be performed during each scan
are coded and inserted into memory with the programmer.
Programmers vary from small hand-held units the size of a large calculator to desktop
standalone intelligent CRT-based units. These units come complete with documentation,
reproduction, I/O status, and on-line and off-line programming ability. Many PLC
manufactures now offer controller models that can use a personal computer as a programming
tool.
Programming units are the liaison between what the PLC understands (words)and what the
engineer desires to occur during the control sequence. Some programmers have the ability to
store programs on other media, including cassette tapes and floppy disks. Another desirable
feature is automatic documentation of the existing program. This is accomplished by a printer
attached to the programmer. With off-line programming, the user can write a control program
on the programming unit, then take the unit to the PLC in the field and load the memory with
the new program, all without removing the PLC.
Selection of these features depends on user requirements and budget. On-line programming
allows cautions modification of the program while the PLC is controlling the process or the
machine.
Scan Cycle of PLC
Reading the inputs: RSLogix Micro Starter copies the state of the physical inputs to the
process-image input register.
Executing the control logic in the program: RSLogix Micro Starter executes the instructions
of the program and stores the values in the various memory areas.
Processing any communications requests: RSLogix Micro Starter performs any tasks
required for communications.
Executing the CPU self-test diagnostics: RSLogix Micro Starter ensures that the firmware,
the program memory, and any expansion modules are working properly.
Writing to the outputs: The values stored in the process-image output register are written to
the physical outputs.
Study of logic gate-
1. OR gate
Ladder Diagram:
Explanation:
The OR gate gets its name from the fact that it behaves after the fashion of the logical
inclusive "or."
The output is "true" if either or both of the inputs are "true." If both inputs are "false,"
then the output is "false."
2. AND gate
A B Output A.B
0 0 0
0 1 0
1 0 0
1 1 1
Ladder Diagram:
Explanation:
A Output
0 1
1 0
Ladder Diagram:
Explanation:
The logical inversion, or NOT, function can be performed on a contact input simply
by using a normally-closed contact instead of a normally-open contact.
Now, the lamp energizes if the contact is not actuated, and de-energizes when the
contact is actuated.
4. NAND gate
A B Output
0 0 1
0 1 1
1 0 1
1 1 0
Ladder Diagram:
Explanation:
Arrangement shows AND gate followed by NOT gate. Hence it is called NOT AND
gate.
Both the inputs A and B have to be at low state to get the output at HIGH state.
NAND gate is composed of two or more input with a single output.
Any one input is in low state also output will be high state.
5. NOR gate
A B Output
0 0 1
0 1 0
1 0 0
1 1 0
Ladder Diagram:
Explanation:
A B Output
0 0 0
0 1 1
1 0 1
1 1 0
Ladder Diagram:
Explanation:
B A Output
0 0 1
0 1 0
1 0 0
1 1 1
Ladder Diagram:
Explanation:
By connecting two XIO contacts in series with parallel to two XIC contacts in series, EX-
NOR gate can be implemented.
When both inputs are identical A=B=O or A=B=1, output goes high.
It implies same here as in EX-OR gate that address must be given same.
By inverting output of EX-OR gate, implementation of EX-NOR can be accomplished.
Conclusion:
From this experiment, we have studied about PLC and Logic gates, Ladder Diagram
Simulation using PLC Ladder Simulator, for logic gates and we have concluded following
points: