Guide to Programmable Logic Controllers
If you’ve ever encountered a programmable logic controller before, you know there’s a lot to learn. Commonly abbreviated as PLC, these controllers are a handy tool, although they can sometimes be challenging to learn.
If, on the other hand, you’ve never encountered a PLC before, there’s no need to worry. You’re in the perfect place, because today we’re going to be giving a whirlwind tour of the basics in programmable logic controllers. Whether you’re brand-new to this or have some small background, this guide is a great place to learn the fundamentals.
What Is a PLC?
Don’t be intimidated by the name. A programmable logic controller is a specialized computer device for use with industrial control systems. They are incredibly versatile and helpful tools that often transcend industry and can be used in many different applications. Just a few of the possible applications for this versatile tool include conveyor systems, manufacturing lines, oil refineries and many, many more.
Mostly, a PLC is a tool that helps control electronic devices by providing a flexible and versatile way to connect the different pieces and allow them to work in tandem.
Every PLC will have a basic computer processor that is designed to gather different inputs and manipulate them into the desired output. They can be programmed in multiple different ways, and thus are highly valued for their versatility and ability to be modified to fit whatever the scenario requires.
Consider, for example, a situation involving a light switch and a light bulb. When you flick the switch, the light switches on and off immediately. There is little versatility in this. If you were to add a PLC into the mix, however, you could begin to introduce some complexities. You could make the light switch blink on and off, or make the light switch off again 30 seconds after it turns on. These and other modifications would suddenly become possible through the simple addition of a PLC.
How Does a PLC Work?
If computers and programming aren’t your forte, don’t worry. No matter what your level of experience is, you can achieve a basic understanding of how these tools operate.
In the simplest terms possible, a PLC accepts inputs from various sources, internalizes them and applies its programming to produce the outputs determined by its programming. Based on this, then, we can see it takes the correct program to get a PLC to produce the desired results.
To understand how PLCs operate, realize they are mainly just smaller, more specialized computers. Because of this, they share much of their language and terminology with regular computers. You’ll no doubt recognize terms like memory, software, central processing unit, communications and more. The main difference is that while a personal computer is designed to exist in the comfort of your home, a PLC is built to function in an industrial world and is meant to control concrete inputs and outputs.
What Are the Basic Components of a PLC?
When it comes to analyzing the different parts of a PLC, it helps to divide them into three basic categories. These categories are:
1. The Power Supply and Rack
The power supply is self-explanatory: the component of the PLC that provides power to the entire system and gives it the ability to run. The rack is a framework of sorts that holds all the other components in place. It forms the outer shell of the unit, which houses all the other inner workings of the device.
2. The Central Processing Unit (CPU)
Perhaps the best comparison for understanding the CPU is to think of it as a brain. This is the part of the PLC that holds the programming and tells the rest of the device how to act and what to do. If the PLC did not have a correctly functioning central processing unit, it might be like a body without a brain — the limbs and organs would all still work, in theory, but there would be nothing telling them what to do or how to move.
The CPU consists of many smaller parts that work together to feed information and instructions throughout the whole unit. A few of these parts include a memory chip, microprocessor and an entire network of circuitry that keeps things running smoothly.
3. The Input/Output Section (I/O)
I/O is the portion of the system that accepts new information from an outside source and also spits out a new function in the form of an output. It is the physical connection between the PLC and the equipment it is hooked up to. Because of this, the input and output station offers places for devices to physically connect to the PLC. These might vary depending on what types of devices and equipment you’ll need to connect.
What Is Basic PLC Programming?
To understand the most fundamental nature of PLC programming, you’ll need to realize the CPU of a PLC controls two separate programs: the operating system and the user program. For simplicity’s sake, we’ll discuss the two separately.
1. The Operating System
The operating system controls the functions of the CPU that are not related to the central task of input and output. In other words, the operating system controls the functions you don’t see, but are necessary for the PLC to work correctly. These include things like restarts, updates, memory functions and establishing connections between any input or output devices. Most of these are tasks and programs that run automatically, without direct commands from you, the user.
2. The User Program
These are the functions that combine to process the inputs and translate them into outputs. This is the part of the program you control, which allows you to dictate the outputs you want. Although both functions are vital to the correct and efficient operation of the PLC, the user program is in charge of the functions that tend to be more visible.
How Do You Program a PLC?
With this basic terminology and understanding under our belts, let’s move to the broader discussion of how to program PLCs.
One of the ways you can program a PLC is through a handheld device or a PC hooked up to your PLC. After you connect either of these devices to the PLC via a cable, you can use the keys on either your laptop or handheld device to enter the code for the PLC, edit it and then transfer it to the CPU of the PLC. Once you’ve completed this step, you can disconnect your programming device, and the code will remain safely stored inside the PLC’s CPU. From there, it will provide instructions to the rest of the unit and govern its operating methods.
It does not matter what you use for your programming purposes. Instead, you should let your preferences dictate your choice of device. The handheld option is more convenient and portable, but it may have more limited capabilities and lack the more familiar keyboard. The laptop is more unwieldy, but it typically has more capabilities and greater processing power.
What Is Ladder Programming for PLCs?
Ladder programming is the most commonly used method for programming a PLC. This type of programming uses symbols instead of letters to simulate ordinary real-world relay logic controls. This has been part of the history of PLCs ever since their beginning, although the number of symbols has dramatically increased since then, resulting in higher capabilities and levels of functionalities. These symbols connect through lines of circuitry and power, directing the flow of electrical current.
This type of programming is called ladder programming — or sometimes ladder logic — because the resulting code somewhat resembles a ladder. If you have a basic understanding of electrical circuits, it’s easy to learn to program a PLC, since the code represents an electrical circuit. The left rail is the positive side, while the right rail is the negative one. The various rungs, of course, stand in for the wiring that runs between the different components.
Using ladder programming, it’s easy to translate from an electrical circuit to a PLC. To use ladder logic to create a PLC program, follow these simple steps.
1. Figure out What Your Program Needs to Do
Before you can begin programming, you need to form a solid idea of what you want your program to do. Do you want to turn on a light switch? Stop a conveyor belt? Pause a machine every five minutes? Whatever you have in mind, you can design a program to do it.
2. List the Conditions
Make a list of all the conditions that will factor into your program. For a simple example, if you turn the light switch upward, the light comes on, and vice versa. Translate all these applicable conditions into a flowchart, so you have a good visual representation to work with.
3. Configure Your Programming Software
Open your laptop or handheld programming device and load up your programming software. Configure it with the settings you’ll need, and be sure to select the ladder language as the programming language you’ll be using. Choose the appropriate hardware processor and name your new program.
4. Add Your “Ladder Rungs”
Now that you have everything set up, you can begin programming in earnest. Add your required number of ladder rungs into the program and address them as necessary. Make sure you treat each input and output properly in your program.
5. Check for Errors
No program is complete until you’ve run it and done a thorough check for errors. It’s always better to catch these now than to wait until they pop up later.
6. Download the Program to Your PLC’s CPU
If your program is complete, the only thing left to do is to transfer it to your PLC. Download it to your PLC’s memory, and when the transfer is complete, disconnect your programming device. Your program is now ready to go.
What Are the Different Types of PLCs?
An important thing to note about PLCs is that there isn’t just one type of unit. Just as there are many different potential applications for PLCs, it only makes sense that there are also many different types of PLCs.
Here are a few of the different varieties you might encounter.
- Compact PLC: Also known as an integrated PLC, these types include multiple modules packed into a single case. Because of this, the manufacturer decides their inputs and outputs, instead of the user.
- Modular PLC: This type features multiple pieces that are all plugged into a single rack. These can come in a variety of different sizes, with differing levels of functionality and power.
- Small, medium and large PLCs: As the names suggest, the difference in these PLCs is their sizes. To make them better suited to different applications, PLCs are available in small, medium or large sizes.
PLC Training Options
This guide has covered many of the basics of PLCs and much of the introductory knowledge you’ll need to begin to understand PLCs. But where do you go from here? How can you train yourself and your employees in a more in-depth, workable knowledge of PLCs and their operation?
The good news is, you’re not on your own. There are plenty of resources that can help you become better acquainted with PLCs in general, and with programming them specifically. Look at local colleges or trade schools for classes. Browse the Internet for tutorial videos and guides. Good old-fashioned books are always an option as well. Check your local library or bookstore for programming guides, as these can be an enormous help in learning ladder logic.
While PLC programming might seem confusing and difficult at first, don’t be discouraged. Remember, as long as you have a basic grasp of electric circuitry, you will be able to understand ladder programming. If you are unfamiliar with the principles of electrical circuits, consider starting your training by learning a bit about this first. Once you’ve learned this, you may have better luck learning ladder programming.
Continue Learning by Subscribing to Global Electronic Services’ Blog Today
Are you interested in this and similar topics? Do you want to continue expanding your knowledge of electronics, machinery, programming and more? There’s an easy way you can do so, and that’s by subscribing to our blog here at Global Electronic Services.
We don’t just pride ourselves on being a top-of-the-line provider of electronic services. We also want to be your partner as you continue learning about these topics and gaining experience and knowledge in all areas related to the electronics industry. And if any of your electronics or equipment need servicing, we can help with that, too. Ready to get started? Subscribe to our blog today to stay in the know.