What is a PLC and how does it work?

A PLC, which stands for Programmable Logic Controller, is an industrial computer that acts as the “brain” that processes input to obtain the desired/controlled output, such as induction motor speed and industrial robot arm position, among others. 

The PLC works similarly to any computer, but it is just designed to work in an industrial environment.

So, it can survive in tough conditions such as excessive heat, dust, vibration, and electrical noise. 

In this article I share a brief history of a PLC, how a PLC is composed, how many types of PLCs there are, how many languages PLCs speak, and finally, the ways to connect a PLC to the load in a correct manner.

The Journey of a PLC

Relay logic is a method of electrical control that uses electromechanical relays to perform logical operations and control circuits.

Before PLCs, industrial automation relied on relay logic systems, large panels full of relays, timers, and wiring.

These were bulky, hard to troubleshoot, and expensive to modify whenever a production line changed.

This was back then in the 1960s; the technology changed, and today we have the PLCs that we are talking about in this article. So, in 1968 the engineers came up with the idea of substituting these bulky relays.

The Main Parts of a PLC

A PLC generally contains four main sections: A power supply, an input part, a Processor (CPU/brain) part, and an output part.

The Main Parts of a PLC

Power Supply

The power supply is the one that gives energy to the CPU. It has a DC-DC converter that takes the normal line voltage to 24VDC to provide DC power to the rest of the connected devices. 

Input Section

This is where the PLC receives signals from the outside world, just like your desktop PC when you click a mouse or when you type something using your keyboard (mouse and keyboard are the inputs).

 But when it comes to a PLC input can be sensors, switches, buttons, or any device that sends information (for example, a temperature sensor or a start button).

Processor (CPU/Brain)

As aforementioned, the CPU is the brain of the PLC. It reads the inputs, processes them according to the program written by the user, and decides/controls what the outputs should do.

Programming Device

Usually it’s a normal PC; after programming using special software, the instructions are loaded to the PLC CPU memory. Then the PLC will be ready to execute these instructions to get the desired output signal.

Output Section

Devices such as motors, lamps, valves, or relays are located at the output section of a PLC.

They are also known by the name of actuators. The CPU tells them when to turn ON or OFF or when to act. 

Note that the devices connected to the input section, as well as those that are connected to the output section, are in general called the field devices.

Types of PLC

PLCs are mainly categorized into two types based on their hardware design: Compact (or Fixed) PLCs and Modular PLCs. 

Although as the technology keeps growing, other classifications have emerged such as Nano/Micro/Mini PLC, safety PLCs and Soft PLCs.

Compact (Fixed) PLC

  • All components (CPU, power supply, and I/O modules) are housed in a single unit.
  • Pros: Simple and low cost.
  • Cons: Limited expansion options.
  • Use: Small, dedicated automation tasks.

Modular PLC

  • Components are separate: CPU, I/O modules, and power supply are installed in racks.
  • Pros: Scalable and flexible.
  • Cons: More expensive and larger.
  • Use: Medium- to large-scale automation.

Other Classifications

  • Nano/Micro/Mini PLCs: These are small in size and have low processing power of the PLC, typically used in very small-scale operations.
  • Safety PLCs: Designed with enhanced safety features to control hazardous processes and protect personnel.
  • Soft PLCs: A general-purpose computer that runs PLC software and functions as a PLC, rather than using a dedicated hardware controller.

Sinking and Sourcing in PLCs

In PLCs, the terms “sinking” and “sourcing” are very important when it comes to physical connection of the PLCs with the input/output (I/O) devices.

They describe how current flows between the PLC I/O terminals and the field devices (sensors, switches, actuators). 

So, during sourcing, current goes from the PLC to the field device, and during sinking, current flows from the field device to the PLC.

Please refer to the diagram shown below for more understanding of these important terminologies. 

The difference between sink and source

Introduction to PLC Programming Languages

For the PLC brain (CPU) to do its job, it needs to be programmed with some instructions (Programming language). A PLC brain understands/talks the following languages.

Ladder Diagram (LD)

This is a graphical language equivalent to traditional electrical relay logic diagrams. It uses contacts as inputs, such as switches, sensors, and coils, and outputs, such as motors and lamps, to represent logical operations.

Function Block Diagram (FBD)

This is also a graphical language that uses predefined function blocks to represent logical functions.

The blocks can be fully functioning components such as timers, counters, and PID controllers, among other components. 

Structured Text (ST)

This language has the ability to use the standard low-level programming instructions like IF-THEN-ELSE, FOR loops, and WHILE loops.

Instruction List (IL)

This also has low-level capability, but it’s a text-based, assembly-like language that uses instructions like LD for load and AND for logical AND.

Sequential Function Chart (SFC)

A graphical language used to organize and structure a PLC program into a sequence of steps, transitions, and actions. 

Main PLC Brands

There are brands like Delta and Noark that are good choices if you have a small project.

But the main brands of PLCs include Siemens, Rockwell Automation (Allen-Bradley), Schneider Electric, Mitsubishi Electric, Omron, and ABB. 

These companies are known for offering innovative, reliable, and extensive ranges of products for industrial automation, though specific brand choice depends on application needs, budget, and industry focus. 

Key Takeaways: What is the PLC?

This article addressed a brief history of a PLC, how a PLC is composed, and types of PLCs.

Furthermore, it discussed how many languages PLCs speak and finally the ways to connect a PLC to the load in a correct manner.

As a result, it can be proved that PLC is indeed the brain of industrial automation. Furthermore, understanding concepts like sinking and sourcing also helps to ensure proper and safe connections between the PLC and field devices, as well as the field personnel/operator. 

If you’re just starting out, remember: learning PLCs is a step-by-step journey, but mastering them opens the door to countless opportunities in automation and control.

Want to keep learning more about the PLCs? Please do not hesitate to read our next article for more beginner-friendly guides.

FAQ: What is a PLC?

What is a PLC and how does it work?

A PLC, which stands for Programmable Logic Controller, is an industrial computer that acts as the “brain” that processes input to obtain the desired/controlled output, such as induction motor speed and industrial robot arm position, among others.

Why were PLCs invented?

Initially, industrial automation relied on banks of hard-wired relays—complex, bulky, and difficult to modify.

PLCs were developed to replace these systems, offering flexibility through programmable logic. 

Who invented the first PLC?

The first PLC (Modicon-084) was created by Richard Morley in 1968, and his team at Bedford Associates. It was specifically made for General Motors.

What are the main components of a PLC?

A PLC generally contains four main sections: an input part, a Processor (CPU/brain) part, and the output part.It may also contain a power source, or you can just add it yourself.

What programming languages are used in PLCs?

PLCs are programmed using IEC 61131-3 standard languages, including:Ladder Diagram (LD): which is a graphical format resembling a relay circuit. Function Block Diagram (FBD): uses reusable logic blocks.

Structured Text (ST): textual, high-level logic with IF/THEN/LOOP structures. Instruction List (IL): low-level, assembly-like text. Sequential Function Chart (SFC): flowchart-like steps and transitions.

Where can I use a PLC?

PLCs are mostly used in industries and control systems, including: Manufacturing lines, automotive assembly, packaging, and industrial robotics. Also, in building systems like elevators, traffic lights, and automatic doors.

How do I choose the right PLC?

This depends on your application requirements, such as the required number of inputs/outputs, Types of inputs/outputs (the latter could be either digital or analog), and the processing capability of a CPU, among other factors. 

What are the steps to learn PLC programming?

Start with beginner-friendly projects like switching the diode ON and OFF then proceed with traffic lights or sump pumps.

Using vendor learning platforms such as Siemens S7-1200 or Rockwell CompactLogix is often recommended for ease of programming.

How does a PLC read sensors?

A PLC reads sensors through its input modules. The sensors send signals to the input modules, which convert them into digital data for the CPU (brain) to manipulate them before sending them to the output modules.

Which of the PLC programming languages is easier to learn for PLC?

Ladder Diagram (LD) is generally considered the easiest programming language to learn for PLCs, especially for beginners with a background in electrical circuits or relay logic.

So, it is a graphical language equivalent to traditional electrical relay logic diagrams. 

What is a Relay?

A relay is one of the most used components in industrial automation and control. In this article, I am going to explain what a relay is, the types of relays, and how to correctly use a relay.

What is a relay?

A relay is an electronically controlled switch. It consists of a set of input terminals for single or multiple control signals and a set of operating contact terminals.

Let’s say you want to turn on a fan when the level of carbon monoxide reaches a certain level; instead of having a carbon monoxide detector and someone to start the fan when it reaches a certain level, most fixed gas detectors will come with a relay, and the relay will turn on or off the fan when the CO levels reach a certain level.

How do relays work?

A relay consists of two parties, the first part is the magnetic coil, a magnetic coil is used to activate the switching action depending if there is electric power or not.

The second part of the relay is the contacts. Contacts, as their name suggests, are used for power connections with the external devices. They are usually normally open, normally closed, and common contacts.

The electromagnet starts energizing when the current flows through the magnetic coil and then intensifies the magnetic field.

The electromagnet becomes connected to the power source through the contacts to the load and a control switch.

The upper contact arm becomes attracted to the lower fixed arm and then closes the contacts, resulting in a short circuit.

The contact then moves in the opposite direction and creates an open circuit once the relay has been de-energized.

The movable armature will return to its initial position when the coil current is off. The force that causes its movement will be almost the same as half the strength of the magnetic force. Spring and gravity provide this force.

Types of relays

There are four types of relays, and each type of relay will require being wired differently. If you do not know what type of relay you have, you can check the connection diagram of the particular relay and figure out which type you have.

SPST – Single Pole, Single Throw

An SPST relay, or single pole single throw relay, is the simplest type of relay out there; it consists of one magnetic coil and one set of contacts. It only connects or disconnects only one contact when it is operated.

SPDT – Single Pole, Double Throw

A Single Pole Double Throw (SPDT) relay is a relay that only has a single magnetic coil and can connect to and switch between 2 contacts.

It is the most used relay type in the industry. It consists of one Coil and 2 sets of Contacts (1 Normally Open & 1 Normally Closed) separated by a Common Contact.

DPST – Double Pole, Single Throw

A DPST or Double Pole Single Throw relay is a type of relay that has two magnetic coils and two Contacts.

Each magnetic coil has one corresponding contact. But both coils are isolated from each other, the same as both contacts are isolated from each other.

It works with two different circuits. It only provides the switching function either on or off. Both the input-output pairs work simultaneously.

DPDT – Double Pole, Double Throw

A Double Pole Double Throw (DPDT) relay is a relay that has 2 magnetic coils and 4 contacts, each magnetic coil has 2 corresponding contacts that it can connect to.

The DPDT Relay represents two sets of SPDT Contacts with the +V connections tied together

Designed for when a single relay is needed to activate/deactivate two external devices, such as a Horn and a Strobe light.

Conclusion

That is it, in this article, we defined what a relay is and the types of different relays that you can find in the industry. thank you for reading.