Learn what a PLC is, what components make up a PLC, how a PLC is programmed, and how a PLC controls a process
This post aims to answer a basic question in industrial automation:
What is a PLC and how does it control a process?
After reading this post, you will know:
Let's start by looking at what a PLC, or Programmable Logic Controller, is and why we use them for industrial automation.
A PLC is a specialized computer that is designed for industrial automation. PLCs are at the core of almost any automated system and it is the PLC that controls the process.
PLCs are used for industrial automation because they are more durable than traditional computers.
PLCs have rugged housings that are designed to withstand harsh industrial environments.
PLCs are designed without moving parts and with proprietary operating systems to make sure that they can run for many years stopping due to parts wearing out or patching requirements.
Finally, PLCs are easy to program using graphical programming languages so that electricians and technicians on the factory floor can debug and modify PLC programs as required.
Now that we know what a PLC is, let's talk about how PLCs work.
The basic operating concept of a PLC is very simple.
A PLC operates cyclically in a continuous loop. In each iteration of the loop, also known as a cycle or scan cycle, the PLC:
You can see a graphical representation of the PLC scan cycle here.
This operating concept is not 100% correct since modern PLCs are capable of multi-tasking and other background tasks like communications are happening. Still, it is good enough to start with.
Now that we know how a PLC works, let's look at an example to see how a PLC controls a process.
Here, we have a simple conveyor.
When the operator pushes the green Start button, the conveyor starts running.
It continues running until someone presses the red Stop button or the tote reaches the end of the conveyor and triggers the sensor mounted there.
Both pushbuttons have built-in lights that are used to indicate when the conveyor is running and when it is stopped.
The PLC is monitoring the inputs for the Start and Stop pushbuttons as well as the input for the sensor at the end of the conveyor.
Based on the status of those inputs and the logic that has been downloaded to the controller, it makes decisions about what should happen.
Based on these decisions, the PLC controls the process by turning on outputs to run the conveyor and control the push button lights.
Here is how that program might look in a PLC
This program defines which inputs the PLC should monitor (DI_Start_PB, DI_Stop_PB, and DI_End_PEC), how the system should react depending on the state of those inputs, and which outputs the PLC should control (DO_Run_MTR, DO_Running_LED, and DO_Stopped_LED).
The logic shown here is written in Ladder Logic, which is a very popular programming language for PLCs.
A program like this is written by a PLC programmer, also known as a controls engineer.
The program defines what inputs should be monitored, what logic should be executed, and what outputs should be controlled.
This program is written using proprietary programming software that is specific to a PLC platform. For example, Allen Bradley Logix 5000 PLCs are programmed using Studio 5000 Logix Designer, and Allen Bradley Micro800 PLCs are programmed using Connected Components Workbench.
In the programming software, the PLC programmer writes logic like what is shown here. After writing the logic for the PLC, the PLC programmer downloads the project to a physical PLC using a USB or Ethernet cable. When the download process is started, the project is compiled into a binary file that can be executed by the PLC's processor and this binary file is transferred to the PLC.
After the program has been downloaded, the programmer can disconnect his computer and the PLC will execute the downloaded project automatically.
Ladder Logic is not the only PLC programming language available. Other programming languages include Function Block Diagram, Structured Text, and Sequential Function Chart. The choice of which programming language to use largely depends on the problem being solved, the industry in question, and the PLC programmer’s preferences. Most PLCs support mixing and matching of programming languages so that the most appropriate language can be selected for different parts of the code.
One important thing to note is that PLCs are not programmed using high-level programming languages like C#, Python, or JavaScript. This is primarily because PLC programming languages are designed to be easy to program and maintain.
Now that we have discussed how a PLC controls a process, let’s discuss the components that make up a PLC.
To start with, all PLCs have a processor. The processor is the component that stores and executes the PLC program.
To download a program to a processor, a PLC needs some kind of communication module. This communication module could be a simple USB port used to create a point-to-point connection between the PLC and a programming device or it could be a high-speed Ethernet connection that let’s the PLC communicate on industrial networks.
Next, a PLC has an input module. This module converts electrical signals sent from devices like sensors and pushbuttons into digital signals that the processor can understand.
The PLC also has an output module that does the opposite of the input module. An output module takes digital signals from the processor and converts them into electrical signals to control devices like lights and motors.
All of these components need power to operate. Power is supplied to the components through a power supply. Typically, this power supply will convert input power at 120V AC to 24V DC to power the other components.
In the image below, you can see all of these components. The components on the left is the power supply, component [0] is the processor, component [1] is an Ethernet communications module, component [2] is an input module, and component [3] is an output module.
In this example which is a ControlLogix PLC system, each component is modularized. That means that each component has its own housing and is assembled together to build a PLC system. In a modular PLC system, an electrical backplane is used to create a connection between the modules and carry power and communication between them.
In other PLC systems, like the CompactLogix PLC system, the components are all integrated into a single housing. Note that when the input and output modules are part of the PLC, they are referred to as embedded IO.
In this post, I introduced some basic concepts about PLCs.
After reading the post, you can;
If you enjoyed this post, consider signing up to the mailing list below to get notified when I release new content on KB Controls.
Get access to all my courses and priority support for free for 30 days.
Sign up to the mailing list to receive a 25% discount off all products.
Learn how to build and test your first project in Studio 5000 Logix Designer using Bit instructions
Learn how to communicate with other devices over an EtherNet/IP network.
Learn how to use program control instructions to change how logic is executed in a PLC