PLC Basics Tutorial: What Is A PLC?
PLC Basics Tutorial: What Is A PLC?
PLC Basics Tutorial: What Is A PLC?
What is a PLC?
NEMA, the National Electrical Manufacturers Association, defines a programmable logic controller (PLC) as: a programmable
controller is a digitally operating electronic apparatus which uses a programmable memory for the internal storage of instructions
for implementing specific functions, such as logic, sequencing, timing, counting and arithmetic, to control through digital or
analog input/output, various types of machines or process.
Programmable Logic Controllers, programmable controllers, or PLCs are specialized industrial computers. The PLC accepts inputs
from switches and sensors (measures or senses the system), evaluates these based on a program (logic), and changes the state of
outputs to control a machine or process.
Initially, programmable logic controllers were used to replace traditional hard-wired relay logic; however, with its ever increasing
functionality it is found in many more complex applications. PLCs are used in any industrial application where operating
requirements are complex, are constantly changing, or where high reliability is necessary.
The advent of the PLC began in the 1960's and 1970's to replace traditional "hard-wired" controls, and has since become the
predominant choice for industrial controls. Before PLCs, much of machine control relied on contacts and relays providing hard-wired
"logic" for machine controls. Changes to the logic were labor intensive and costly.
In 1968, GM's Hydramatic division specified the design criteria for what would become the first programmable logic controller. They
requested a solid-state system that would:
survive the industrial environment
be easily programmed by plant engineers and technicians, and
be easily reprogrammed and re-used
The winning proposal came from Bedford Associate - which introduced the MOdular DIgital CONtroller (MODICON). The MODICON
is still a popular brand of PLC today, but is owned by Schneider Electric. Other prevalent PLC brands today are: Allen-Bradley,
Siemens,Omron,and GE.
The Automotive Industry was a major early adopter of programmable logic controllers (PLC). They wanted a programming method
that could be easily understood by their existing controls engineers and technicians. The result of this desire was a programming
language called Relay Ladder Logic (or "ladder logic").
The layout of Ladder Logic is very similar to reading the diagrams for hard wired relay controls. Ladder Logic is still one of the most
popular "language" for programming PLCs, but many others have developed over the years.
Programmable controllers have grown throughout industrial control applications because of the ease they bring to creating a
controller: ease of programming, ease of wiring, ease of installation, and ease of changing. PLCs span a wide range of sizes, but all
contain six basic components:
We will start with explaining the physical components you see when looking at a PLC system - and then explore what goes on inside
each part, and how the components relate to each other.
Rack Assembly
Most medium to large PLC systems are assembled such that the individual components - CPU, Input/Output, power Supply - are
modules that are held together within a rack.
In smaller PLC systems - all of these components may be contained in a single housing or "brick" - these smaller systems are
sometimes referred to as "bricks" or "shoebox" PLCs.
Power Supply
The power supply provides power for the PLC system. The power supply provides internal DC current to operate the processor logic
circuitry and input/output assemblies. Common power levels used are 24V DC or 120 VAC.
Processor (CPU)
The processor, central processing unit, or CPU is the "brain" of the PLC. The size and type of CPU will determine things like: the
programming functions available, size of the application logic available, amount of memory available, and processing speed.
Understanding the CPU can be a complex subject and we will tackle that in other articles.
Input/Output Assembly
Inputs carry signals from the process into the controller; they can be input switches, pressure sensors, operator inputs, etc. These
are like the senses and sensors of the PLC.
Outputs are the devices that the PLC uses to send changes out to the world. These are the actuator the PLC can change to adjust
or control the process - motors, lights, relays, pumps, etc.
Many types of inputs and outputs can be connected to a PLC, and they can all be divided into two large groups - analog and digital.
Digital inputs and outputs are those that operate due to a discrete or binary change - on/off, yes/no. Analog inputs and outputs
change continuously over a variable range - pressure, temperature, potentiometer.
Programming Device
The PLC is programmed using a specialty programmer or software on a computer that can load and change the logic inside. Most
modern PLCs are programmed using software on a PC or laptop computer. Older systems used a custom programming device.
The operation of the PLC system is simple and straightforward. The Process or CPU completes three processes: (1) scans, or
reads, from the input devices (2) executes or "solves" the program logic, and (3) updates, or writes, to the output devices.
PLC Program
For the PLC to be useful, it must first have a Program or Logic for the CPU to execute. A system engineer or PLC programmer will
first create the program logic in a programming device (these days it is usually software running on a personal computer). This logic
can be written in Ladder Logic, Instruction List, Sequential Function Charts, or any of the IEC languages.
The programmer will then download the program to the PLC. This is usually done by temporarily connecting the programmer to the
PLC. Once the program is installed or downloaded to the CPU - it is usually not necessary for the PC to remain connected.
Basic Scan
Once the program is in the CPU - the PLC is then set to "run", and the PLC executes the application program repeatedly. In addition
to executing the program, the CPU regularly reads the status of the input devices, and sends data to the output devices. The Input
system senses the status of the real world inputs (a switch, a level, etc.), translates them to values that can be used by the CPU,
and writes those values to the Input table. The application program is executed, and writes values to the Output table. The Output
system then converts the output value to a real world change (motor turns on, valve opens, etc.)
This process of reading inputs, executing logic, and writing outputs is called the PLC Scan or Sweep.
The CPU continuously Reads Inputs, Solves Logic, and Writes to the outputs (there are other tasks the CPU does - which will be
discussed later). It is important to understand the scan because it may dictate how a programmer structures logic.
Memory
The control program or application program is stored in memory. As the PLC executes logic, it may also read and store values to
memory. The values may also be used and refernced by the application program.
The term I/O refers to Input/Output. I/O is information representing the data that is received from sensing devices and the
commands that are sent to actuating and indicating devices. The I/O System is the collection of physical elements of the control
system that either provide or use I/O data. There are two major types of I/O:
1. Digital - binary devices which must be in one of only two states: on or off.
2. Analog - continuos devices - sense and respond to a range of values.
Digital IO
Digital input devices may be either on or off; they may not hold any other values. For example, digital position sensors do not sense
how close an object is, they only tell if the object is within a range of positions. Common digital field input devices include
pushbuttons, limit switches, and photoeyes. Common digital output devices include relays, motor starters, and solenoid valves.
Analog IO
Analog input devices sense continuous parameters. The information that they provide is given as a continuous range of values, not
just an on or off indicator. Common analog inputs
are pressure, temperature, speed, etc. Analog output devices respond to a range of output values from the controller. Common
analog output signals include motor speed, valve position, air pressure, etc.
I/O modules connect "real world" field devices to the controller. They convert the electrical signals used in the field devices into
electronic signals that can be used by the control system, and translate real world values to IO table values.
I/O modules communicate with PLC CPU in one of three ways:
Backplane - The I/O modules can be located in the same rack or station. Communications then takes place within the rack or across
the backplane.
Backplane extension - backplane extension modules allow I/O modules to be located in racks or stations which are separated from
the controller.
Device network - modules can communicate with a controller over a network. Industrial networks are used to interconnect field level
devices with controllers. Common IO networks are FieldBus, Profibus, and DeviceNet.
The number of I/O devices used within a control system is called its “point count”. Analog device data requires significantly more
manipulation and processing than digital device data. Digital and analog point counts are typically considered separately. The total
number of digital and analog points is used to give an indication of the size of a control system.
PLC Communications
To control a machine or process, many times multiple controllers or intelligent devices must work together to accomplish the task. In
order to work together, these devices must communicate. In order to program a PLC, communications must take place - becasue
the Programming device (computer) must communicate with the PLC CPU in order to transfer the configuration and control logic
before the PLC can even begin to run. For these reasons, it is important for anyon in automation to have a basic understanding of
PLC communications.
Types of Communications
There are three basic levels/categories of communications that we are usually concerned with in industrial control: serial
communications, industrial communications networks, and industrial I/O networks.
The most basic form of communication is a direct, one way, connection between two devices where data is transmitted one bit at a
time. We call this serial communication.
An Industrial Network is a system of electronic devices that are connected in order to share information. The network can consist of
PLC Controllers, I/O Devices, Operator Interfaces, HMI/SCADA computers, and many other elements. Each element is uniquely
addressable - giving each component (controllers, I/O devices, Operator interfaces, etc) a unique name or label. Industrial networks
provide bi-directional, real-time, (sometimes deterministic)communication. Each element has specific electronic components to allow
the transfer of data between the elements, on a shared media, and according to a protocol.
Network protocols establish the rules that must be followed for two or more devices to share data. They describe how devices
establish and maintain communications. Examples of network communication protocols include DeviceNet, Profibus-DP, and
Ethernet.
Deterministic Network
Many industrial networks are deterministic. If a network is deterministic, it means that communication occurs within a predetermined
time span. Industrial networks value determinism because many control systems require predictable, real-time response to data.
(You would not want to miss a critical alarm because of someone sending a 10Mg e-mail)