A Guide to Programmable Logic Controllers (PLCs): Back to Basics
Left sideBar (rightnow dont work on this)
Looking for top-of-the-line components that can help you build a future-focused system that delivers?

We offer a wide range of control products from motor controls to terminal blocks, our inventory is diverse and designed to meet any need.

Contact us to learn more about what we provide and how we can deliver robust solutions to power your next project.

Introduction to PLCs

Today’s industrial automation systems are more advanced and tech-savvy than ever before. Yet, they didn’t get this way on their own!

Programmable Logic Controllers (PLCs) form their backbone for almost 60 years, allowing internal components to function together as a seamless unit. Versatile and modifiable, these digital computers are essential to many of the systems and devices we rely on today.

Join us as we take an in-depth look at PLC basics, allowing even the non-initiated to understand how the components work and why they’re so important.

What is a Programmable Logic Controller?

Before we get too far into technical specifics, let’s review how a PLC system operates.

It’s a specialized, hardened, computer device designed for use within industrial control systems. It controls devices and equipment by connecting different units and enabling them to work in a coordinated manner.

What gives it this power?

At the core of every PLC is a basic computer processor that gathers various inputs and evaluates them to achieve the desired output. The inputs can be digital or analog. As users can program the system in multiple ways to fit a certain scenario, PLCs within many applications across various industries, including conveyor systems, oil refineries, manufacturing lines and more.

While these might be more sophisticated scenarios, consider the interaction between a simple light switch and a light bulb. By flipping the switch, a user can only turn the light on or off. There is little versatility or flexibility in this application.

Now, say a PLC joins the mix. Suddenly, the user can create more complex controls. For instance, he can make the light blink on or off or make the light turn off one minute after it turns on. Now think of thousands or even tens of thousands of circuits all being controlled in coordination with each other. While that is a simple explanation, that is essentially what a PLC does.

What are the Key Features of a PLC?

A Programmable Logic Controller (PLC) is instrumental in automation, offering several vital features. Here’s a breakdown:

A PLC is the key to automation and carries various important features. Let's see them:

Input/Output (I/O) Modules in Brief:

Functionality: The basic module of a PLC is an I/O. These modules form the communication interface between the CPU of a PLC and external machinery.

Types: Inputs can be in the form of analog or digital, which would include sensors, meters, or switches. Outputs also differ, from relays and lights to valves and drives.

Flexibility: I/O setup can be designed by users according to the application requirements, with component mix and match to perform accordingly.

Communication Capabilities

  • System Integration: Most often, PLCs have to communicate with other systems, such as the Supervisory Control and Data Acquisition (SCADA) system, which will handle a lot of connected devices.
  • Ports & Protocols: PLCs come designed with the necessary ports to facilitate easy interaction and support multiple communication protocols relevant to a large number of industrial systems.

Human Machine Interface (HMI)

  • Real-Time Interaction: Through this interface, human interaction with the PLC occurs in real time. An HMI may range from very basic functionality, such as text display with a keypad, to more complex interfaces operated through touch screens.
  • Usability: With the help of these tools, the human-machine interfaces make it really easy to observe data and input information into the PLC. This makes it user-friendly for control and changes in operations at any given moment.

How Does PLC Works?

We’ve covered that a PLC relies on a computer processor to turn myriad inputs into logic to control a myriad of outputs. Yet, how does this occur?

As the PLC scans inputs from multiple sources, it scans them and internalizes them. Then, it executes the user programming to enact the desired outputs. Next, it communicates any necessary information to a control network such as Modbus or Ethernet IP. Because PLC’s are in charge of mission critical systems and there are usually people near machines, a series of diagnostics are run to make sure everything is in order, before it scans the inputs again. This entire process is the “scan cycle.”

The larger the number of inputs, the larger the PLC program, the longer the scan cycle. The scan cycle is measured in milliseconds, more commonly known as “fast.” However, there are some applications where fast isn’t fast enough. A Programmable Automation Controller, or PAC, may be needed. A PAC uses multiple CPUs in a single system or chassis to provide parallel processing, or specialized processing of different facets of the application.

Therein lies the importance of user programming, as the program is what causes the PLC to produce the desired results. Without it, the PLC is just an expensive doorstop.

In this way, a PLC is often described as a small, specialized computer. It shares similar terminology with traditional computing systems, including memory, software, CPU, I/O system and more. Yet, a PLC is made to function in an industrial environment, controlling concrete inputs and outputs from devices, machines and workers, while a personal computer is built to exist in your home or office.

Basic PLC Components

PLCs come in many sizes and feature different levels of capabilities. Some main classifications include smart programmable relays, compact PLCs, modular PLCs, and small-medium-large PLCs.

Compact PLCs

Also known as integrated PLCs, or smart programmable relays, these systems feature a complete system all packed into one small case. Due to this design, the manufacturer, rather than the user, will decide the number and types of inputs and outputs.

Modular PLCs

These PLCs comprise multiple pieces all plugged into a single rack. Modular PLCs can come in many sizes, with varying levels of power and capability.

Small, Medium and Large PLCs

These PLCs differ in size, according to the specific applications for which they are suited.

Though these PLCs are all far from one-size-fits-all, regardless of category, each will include some form of these four components:

  • Central Processing Unity
  • Rack or Mounting
  • Power Supply
  • Input/Output (I/O) Section

Let’s review each of these in detail so you understand how the components work together.

1. Power Supply

As its name implies, the power supply is the component that keeps the PLC running, delivering 24VDC or 120VAC line voltage in most cases. Most power supplies contain a battery back-up that prevents data loss during a power outage.

2. CPU is the Central Processing Unit

The CPU executes the PLC program. In addition to running the PLC program, the CPU interfaces with the unit’s other components. The CPU is where you will find the microprocessor, responsible for coding, decoding and computing data.

ROM is Read Only Memory. ROM can be read by not written to. It is used to store programs and parameters that should not be altered. It is where the PLC operating program is stored.

RAM is Random Access Memory. RAM can be written and read. Information in RAM can be altered. RAM is where the user program is stored. Information in RAM can be lost during a power outage. A battery back is used to save the RAM information should a power outage occur.

EAPROM is Electronically Alterable Programmable Read Only Memory. Information in an EAPROM is not subject to loss due to a power outage. EAPROM is used to store user data without the need for external power. Think of your Roku device or something similar. You can unplug it, store it away, come back months later, plug it back in and hook it up. All your favorites and applications are still there and ready to go.

3. Input/Output Systems

The PLC’s I/O system is the system that accepts new information from outside sources and creates a new function in the form of an output. These input and output modules are important for linking the PLC to the machine. Input devices like sensors, switches, and meters send important data to the CPU. On the output side, devices like relays, lights, valves, and drives can be activated to do certain tasks.

I/O modules can be analog or digital, giving flexibility based on what the application needs. Users can combine different I/O modules to set up the PLC exactly as needed for the best performance and adaptability.

How Does a PLC Handle Communications with Other Systems?

A Programmable Logic Controller (PLC) is designed in such a way that it can communicate smoothly not only to process its inputs but also with other systems and control its outputs. This is necessitated in the industrial sector, where operations are interconnected for reasons of efficiency and coordination.

Connectivity Options

PLCs have several ports and support various communication protocols. This allows them to interface with a broad range of external systems. For instance, a PLC may be interfaced with:

  • Supervisory Control and Data Acquisition (SCADA) Systems: They monitor several devices in an industrial establishment; data from the PLCs are also required to administer and regulate the processes.
  • Human-Machine Interfaces (HMIs): HMI allows operators to communicate with machines and systems directly, frequently based on the data given by the PLC.
  • Enterprise Systems: Some of the PLCs are interconnected with Manufacturing Execution Systems (MES) and Enterprise Resource Planning (ERP) systems to analyze data at an enterprise level.

Communication Protocols

To ensure compatibility and effective data exchange, PLCs use various protocols, such as:

  • Modbus: It is one of the most commonly used in industries and a very simple and reliable one.
  • Profibus/Profinet: This protocol is used in high-speed data exchange, and generally, it is used in large automation networks.
  • Ethernet/IP: This industrial protocol allows real-time data transfer since it makes maximum use of Ethernet technology, and it applies to both automation control and information systems.

Practical Applications

Communication capabilities extend to exporting application data such as operational metrics from the PLC to a SCADA system. This allows continuous monitoring and optimization of the processes by making available real-time data on equipment status and performance.

Common features that designers look while specifying an enclosure for a PLC

When designers select enclosures for Programmable Logic Controllers (PLC), they prioritize several essential features to ensure functionality and safety. Key considerations include:

Integration Flexibility:

Designers often look for enclosures that facilitate easy installation of PLCs. This includes options for incorporating DIN rails and mounting panels which streamline the setup process.

Durability and Material:

The construction of the enclosure is crucial. Materials such as polycarbonate, ABS, steel, or aluminum are preferred for their durability and ability to withstand industrial environments.

Environmental Protection:

To safeguard against industrial hazards, enclosures should meet specific standards. NEMA or IP ratings confirm that they can protect against dust, water, and other external factors that could damage the PLC.

Electromagnetic Compatibility:

Enclosures that offer protection against electromagnetic interference (EMI) and radio frequency interference (RFI) are critical, especially in environments with numerous electronic devices.

Mounting Requirements:

Depending on the application, designers may need enclosures with mounting flanges. These are useful for installations where the enclosure must be mounted on a surface.

Compliance and Testing:

Lastly, ensuring the enclosure is UL tested and complies with all relevant NEMA and IP standards is a non-negotiable factor, ensuring safety and adherence to legal requirements.

These features combine to make sure that the enclosure not only fits the PLC physically but also complements its operational needs in harsh industrial settings.

Operating System vs. User Program

In the world of PLC programming, you’ll often hear of the CPU executing two different types of programs: the operating system and the user program. Let’s take a look at key differentiators between the two.

Operating System

The operating system (OS) of a PLC includes tasks and programs designed to run automatically, meaning they don’t require direct user commands to function.

It organizes all the functions, sequences, and operations of the CPU not associated with a specific control task. Key OS tasks include:

  • Initiating a warm restart and hot restart
  • Updating and outputting I/O process image tables
  • Executing the user program
  • Managing memory areas
  • Detecting and calling interrupts
  • Creating a connection with programmable devices

User Program

The user program is the combination of the various functions a PLC requires to process a given automated task. In other words, it’s the part of the PLC that allows operators to dictate the outputs they desire, stored in the PLC’s internal memory.

Though it’s in charge of the more visible functions, the user program works with the PLC operating system.

Programming a PLC

One common way to program, modify or troubleshoot a PLC is through a PC-based device in conjunction with the manufacturer’s software. Also used are proprietary handheld devices hooked up to the PLC via a cable.

While a handheld device is often preferred for its portability and convenience, it may lack a traditional keyboard and have limited capability. On the other hand, though a PC device is a little bulkier, it will typically possess more robust processing power. For instance, it allows users to run a program in either online or offline mode in addition to editing, monitoring, diagnosing and troubleshooting the program.

Regardless of the system, you can use your laptop or handheld device to enter the PLC program. From there, you can edit the code and transfer it to the CPU.

Then, disconnect your programming device, as the code is now stored inside the CPU, where it can instruct and govern the operations of the rest of the unit.

An Intro to Ladder Programming

When discussing PLC programming basics, you may hear the term “ladder programming.” What does this mean?

There are two main categories of PLC programming languages. Specific languages used will vary depending on the manufacturer. While some have their own, specialized languages, standard ones fit into one of two categories: textual language or graphical language.

The IEC 61131-3 standard, established by the International Electrical Code, specifies five primary languages used for programming programmable logic controllers (PLCs). This standard aims to streamline the development process and ensure compatibility and interoperability across different control systems.

Programming most Programmable Logic Controllers (PLCs) is quite straightforward, utilizing a standard computer along with specialized PLC programming software. According to the International Electrical Code's IEC 61131-3 standard, there are five specified languages designed for this purpose. These programming languages cater to different programming preferences and requirements:

  • Text Interfaces: The remaining two languages use a text-based approach, requiring programmers to write code directly. This method is often favored by those who prefer a more traditional coding environment.
  • Graphical Interfaces: Three out of the five languages offer a graphical approach, which allows programmers to visually construct the logic in a more intuitive and accessible manner.

These diverse options ensure that programmers can select a language that best fits their skill set and project needs, facilitating efficient and effective PLC programming via standard computer setups.

Textual language includes:

  1. Structured Text (ST) - This high-level text-based language resembles traditional programming languages like Pascal. ST is used for writing complex procedures and algorithms.
  2. Instruction List (IL) - Similar to assembly language, IL is a low-level text-based option, ideal for executing simple operations sequentially.

Graphical language includes:

  1. Ladder Diagram (LD) - This graphical programming language is reminiscent of relay logic diagrams and is widely used for its ease of understanding and simplicity.
  2. Function Block Diagram (FBD) - Another graphical language, FBD allows the programmer to build complex system behaviors by connecting function blocks which encapsulate specific functionality.
  3. Sequential Function Chart (SFC) - Also graphical, SFC is used for outlining process sequences and managing different operation states in a visual format.

In most cases, users prefer graphical languages over text-based ones, as they are simpler and more convenient. Within this category, ladder diagrams tend to prevail for their ease of use.

These languages provide the flexibility to select the most appropriate method based on the specific demands of a programming task, ensuring efficient and effective PLC programming across various industrial applications.

The Structure of Ladder Logic

This graphical language has been around since the dawn of modern PLCs in the early 1970s, first used because it borrowed from the relay diagrams with which plant electricians were already familiar.

Now, the number of available symbols has grown over time, leading to more advanced and diverse functionalities. The PLC relies on these symbols to simulate real-world relay logic controls, connecting them through lines of circuitry and power to direct the flow of the electrical current.

Often called ladder logic, ladder programming gets its name because the code that results assembles a ladder, comprised of the following symbols:

  • A power rail to the left
  • A power rail to the right
  • Individual circuits (“rungs”) connecting the left and right power rails

Common Logic Systems

While ladder logic is a full language of symbols, there are some that you will see more than others, especially in diagrams. Let’s review a few.

  • Contact Symbols

These come in two types: “Normally Open” (NO) and “Normally Closed” (NC). A light switch is an example of a NO circuit, as it stays off unless someone turns it on. Other uses for the NO symbol include power buttons and other internal programmers.

On the other hand, an NC contact represents a circuit that remains active until an input triggers a shutdown. Uses for the NC symbol include fail-safe features, heat monitoring, and “Stop” buttons.

  • Output Symbol

The output symbol is a common representation for warning signs, indicator lights, and motor contactors. The output for each turns on when the corresponding input becomes energized.

  • One-Shot Positive Edge Connections

These outputs are turned on if a given condition changes from “false” to “true” over the time it takes for the PLC to complete one scan. It’s often used for counters and math commands.

  • Timer Delays (On/Off)

Timer instructions allow for on-delayed or off-delayed events. A Timer Delay-On system begins a timer to turn the system on when the PLC input energizes, giving it time to warm up before operation. This works well for delaying siren sounds and facilitating sequence start delays.

A Timer Delay-Off system puts this delay at the end of operation, allowing for time to pass between the shut-off operation and the actual system shutdown. It’s ideal for automatic displays and any machinery that’s susceptible to accidental shutoff.

  • Comparisons

This system will determine if a given value is greater than, less than, or equal to another value. One application is in batching systems, which will use comparisons to ensure that all package components are the same weight.

  • Calculators

Math instructions or calculators enable simple addition and subtraction functions, allowing PLCs to calculate data such as motor speed. In addition to these typical numerical functions, they can also power more complex transcendental functions such as square roots, as well as trigonometric sine, cosine, and tangents along with their inverse forms (arc sine, arc cosine, and arc tangent).

  • Special Instructions

Advanced instructions may include communication directions, PID loops, drum sequences, shift registers, ramp generators, and more.

  • Function Blocks

When building a PLC ladder, users can incorporate function blocks that feature more complex instructions. In addition to improving scan time, these blocks can replace entire physical components of your system, such as hard-wired mechanical timers. One example includes:

  • And/Or Logic

Using function blocks, you can condense the rungs of your ladder by incorporating “AND” logic that requires the ignition of two or more inputs to trigger an output. For example, a technician will have to press two buttons for a given machine to turn on.

You can also apply the same concept to “OR” logic. If “AND” logic is akin to a series circuit, “OR” logic is its counterpart or a parallel circuit. It’s used within function blocks to require one input or another.

This makes it ideal for machines that have more than one control panel with an ON/OFF switch at either end. With “OR” logic, users can press either switch to achieve the same effect.

Creating a PLC Program

If you want to use ladder logic to create a PLC program, let’s review the steps to take.

1. Determine Program Functions

First, determine what you want your program to do.

Do you want to power on a light switch? What about turn off a conveyor belt or enable a machine to pause every three minutes? There is no right or wrong answer, but you’ll need a clear view of the output function before you begin.

2. List Program Conditions

Next, list all the conditions that will play into your program. Using the light switch example, one condition would be that when you flip the switch upward, the light comes on. Then, when you flip it downward, the light turns off.

Create a flowchart referencing these conditions for visual representation.

3. Configure Your Software

Now, you’re ready to open your handheld or PC-based device and load your programming software. Configure it with the required settings and set your language to “ladder logic language.” Finally, select the appropriate hardware processor and give your new program a name.

4. Add Your Rungs

With your power rails in place, you can begin programming your ladder “rungs.” Add your necessary number of rungs into the program, paying close attention to each input and output.

5. Scan for Errors

It’s essential to scan your program for errors at this juncture, catching them now rather than going back later.

6. Download the Program

Your last step is to download the program to your PLC. Download it to the system’s memory. When the transfer is done, you can disconnect your programming device.

What are the drawbacks of using PLCs?

When considering the integration of Programmable Logic Controllers (PLCs) into your operations, it is essential to recognize that they may not be the ideal solution for every application. Here, we'll delve into some of the key disadvantages associated with PLC technology.

Limited Complex Data Handling

One of the primary concerns with PLCs is their restricted capability in managing highly complex data or overseeing numerous processes that require analog input. As many manufacturing plants move towards more sophisticated and interconnected systems, the need for more advanced control technologies like Distributed Control Systems (DCS) becomes apparent.

Proprietary Software Issues

Another significant hurdle arises from the proprietary nature of the software used by PLCs from various manufacturers. Despite PLCs often sharing common programming language standards, the lack of interoperability between different brands can pose challenges during implementation and maintenance.

Susceptibility to Interference

PLCs are electronic devices and, like their counterparts, are susceptible to issues such as electromagnetic interference (EMI). This vulnerability can lead to disruptions such as memory corruption and communication breakdowns, which can severely affect their operation and reliability.

By understanding these drawbacks, organizations can better assess whether PLCs are the right choice for their specific needs or if alternative solutions might be more appropriate. This evaluation is crucial for maintaining efficient and reliable operations in technologically advanced environments.

A Comprehensive Look at PLC Basics

As industrial control systems continue to advance in terms of sophistication and function, PLCs will become even more multi-faceted and diverse. While this guide to PLC basics is a helpful start, it’s important to stay on top of these trends to maintain your competitive advantage.

Want more information on industrial controls? Looking for top-of-the-line components that can help you build a future-focused system that delivers?

That’s where we come in.

We offer a wide range of control products in our online shop. From motor controls to terminal blocks, our inventory is diverse and designed to meet any need.

Contact us to learn more about what we provide and how we can deliver robust solutions to power your next project.

Disclaimer:
The content provided is intended solely for general information purposes and is provided with the understanding that the authors and publishers are not herein engaged in rendering engineering or other professional advice or services. The practice of engineering is driven by site-specific circumstances unique to each project.

Consequently, any use of this information should be done only in consultation with a qualified and licensed professional who can take into account all relevant factors and desired outcomes. The information was posted with reasonable care and attention. However, it is possible that some information is incomplete, incorrect, or inapplicable to particular circumstances or conditions. We do not accept liability for direct or indirect losses resulting from using, relying or acting upon information in this blog post.

ISO 9001:2015
Certified
17+ Million Product
Configurations
Lifetime
Warranty
Guaranteed
Same-Day Shipping
Advantage Pricing
Save up to 40%
© 1976-2025 c3controls