PLC 1
PLC 1
PLC 1
Contents
1 Introduction
o 1.1 What is a Programmable Logic Controller (PLC)?
o 1.2 PLC usage scenarios
o 1.3 History of PLCs
o 1.4 Recent developments
2 Basic Concepts
o 2.1 How the PLC operates
2.1.1 Scan cycle
3 Basic instructions
4 External links
Introduction
What is a Programmable Logic Controller (PLC)?
A Programmable Logic Controller, or PLC, is more or less a small computer with a built-in
operating system (OS). This OS is highly specialized and optimized to handle incoming events in
real time, i.e., at the time of their occurrence.
The PLC has input lines, to which sensors are connected to notify of events (such as temperature
above/below a certain level, liquid level reached, etc.), and output lines, to which actuators are
connected to effect or signal reactions to the incoming events (such as start an engine, open/close
a valve, and so on).
The system is user programmable. It uses a language called "Relay Ladder" or RLL (Relay
Ladder Logic). The name of this language implies that the control logic of the earlier days, which
was built from relays, is being simulated.
Before the PLC, control, sequencing, and safety interlock logic for manufacturing automobiles
was mainly composed of relays, cam timers, drum sequencers, and dedicated closed-loop
controllers. Since these could number in the hundreds or even thousands, the process for
updating such facilities for the yearly model change-over was very time consuming and
expensive, as electricians needed to individually rewire the relays to change their operational
characteristics.
Digital computers, being general-purpose programmable devices, were soon applied to control
industrial processes. Early computers required specialist programmers, and stringent operating
environmental control for temperature, cleanliness, and power quality. Using a general-purpose
computer for process control required protecting the computer from the plant floor conditions.
An industrial control computer would have several attributes: it would tolerate the shop-floor
environment, it would support discrete (bit-form) input and output in an easily extensible
manner, it would not require years of training to use, and it would permit its operation to be
monitored. The response time of any computer system must be fast enough to be useful for
control; the required speed varying according to the nature of the process.[1] Since many
industrial processes have timescales easily addressed by millisecond response times, modern
(fast, small, reliable) electronics greatly facilitate building reliable controllers, especially because
performance can be traded off for reliability.
One of the very first 084 models built is now on display at Modicon's headquarters in North
Andover, Massachusetts. It was presented to Modicon by GM, when the unit was retired after
nearly twenty years of uninterrupted service. Modicon used the 84 moniker at the end of its
product range until the 984 made its appearance.
Modern PLCs can be programmed in a variety of ways, from the relay-derived ladder logic to
programming languages such as specially adapted dialects of BASIC and C. Another method is
state logic, a very high-level programming language designed to program PLCs based on state
transition diagrams.
Many early PLCs did not have accompanying programming terminals that were capable of
graphical representation of the logic, and so the logic was instead represented as a series of logic
expressions in some version of Boolean format, similar to Boolean algebra. As programming
terminals evolved, it became more common for ladder logic to be used, for the aforementioned
reasons and because it was a familiar format used for electromechanical control panels. Newer
formats such as state logic and Function Block (which is similar to the way logic is depicted
when using digital integrated logic circuits) exist, but they are still not as popular as ladder logic.
A primary reason for this is that PLCs solve the logic in a predictable and repeating sequence,
and ladder logic allows the programmer (the person writing the logic) to see any issues with the
timing of the logic sequence more easily than would be possible in other formats.
A PLC is primarily used to control machinery. A program written for a PLC consists basically of
instructions to turn on and off outputs based on input conditions and the internal program. In this
respect, it is similar to how a standard computer application is used. Once a PLC program is
activated, however, it will typically run continuously as a loop for an indefinite period. PLC-
based systems are frequently used not only to control simple devices such as a garage door
opener, but also for solving complex application scenarios, such as controlling a whole house,
including switching lights on or off at certain times, monitoring custom built security system,
and so on.
Most commonly, a PLC is found inside of a machine in an industrial environment. A PLC can
run an automatic machine for years with little human intervention. They are designed to
withstand most harsh environments.
History of PLCs
When the first electronic machine controls were designed, they used relays to control the
machine logic (i.e. press "Start" to start the machine and press "Stop" to stop the machine). A
basic machine might need a wall covered in relays to control all of its functions. There are a few
limitations to this type of control.
Relays fail.
The delay when the relay turns on/off.
There is an entire wall of relays to design/wire/troubleshoot.
A PLC overcomes these limitations, it is a machine controlled operation.
Recent developments
PLCs are becoming more and more intelligent. In recent years PLCs have been integrated into
electrical communications such as Computer network(s) i.e., all the PLCs in an industrial
environment have been plugged into a network which is usually hierarchically organized. The
PLCs are then supervised by a control centre. There exist many proprietary types of networks.
One type which is widely known is SCADA .
Basic Concepts
How the PLC operates
The PLC is a purpose-built machine control computer designed to read digital and analog inputs
from various sensors, execute a user defined logic program, and write the resulting digital and
analog output values to various output elements like hydraulic and pneumatic actuators,
indication lamps, solenoid coils, etc.
Scan cycle
Exact details vary between manufacturers, but most PLCs follow a 'scan-cycle' format. PLC
scans programme up to bottom & right to left.
Overhead - Overhead includes testing I/O module integrity, verifying the user program logic
hasn't changed, that the computer itself hasn't locked up (via a watchdog timer), and any
necessary communications. Communications may include traffic over the PLC programmer port,
remote I/O racks, and other external devices such as HMIs (Human Machine Interfaces).
Input scan
A 'snapshot' of the digital and analog values present at the input cards is saved to an input
memory table.
Logic execution
The user program is scanned element by element, then rung by rung until the end of the
program, and resulting values written to an output memory table.
Diagnosis and communication
is used in many different disciplines with variations in the use of logics, analytics, and
experience to determine "cause and effect". In systems engineering and computer science,
it is typically used to determine the causes of symptoms, mitigations, and solutions. it is
communicate to input module and send message to output module for any incorrect data
files variations.
Output scan
Values from the resulting output memory table are written to the output modules.
Once the output scan is complete the process repeats itself until the PLC is powered down.
The time it takes to complete a scan cycle is, appropriately enough, the "scan cycle time", and
ranges from hundreds of milliseconds (on older PLCs, and/or PLCs with very complex
programs) to only a few milliseconds on newer PLCs, and/or PLCs executing short, simple code.
Basic instructions
Be aware that specific nomenclature and operational details vary widely between PLC
manufacturers, and often implementation details evolve from generation to generation.
Often the hardest part, especially for an inexperienced PLC programmer, is practicing the mental
ju-jitsu necessary to keep the nomenclature straight from manufacturer to manufacturer.
Latching Relays
(OTL) - OuTput Latch.
(OTU) - OuTput Unlatch.
Generally, the unlatch operator takes precedence. That is, if the unlatch instruction is true then
the relay output is false even though the latch instruction may also be true. In Allen-Bradley
ladder logic, latch and unlatch relays are separate operators.
However, other ladder dialects opt for a single operator modeled after RS (Reset-Set) flip-flop IC
chip logic.
Jump to Subroutine
(JSR) - Jump to SubRoutine
For jumping from one rung to another the JSR (Jump to Subroutine) command is used.