Programmable logic controllers (PLCs) are small industrial computers that contain hardware and software and are designed to automate customized control processes. PLCs are often used in factories and industrial centers for the automation of industrial electromechanical processes to control motors, pumps, lights, fans, machine control circuit breakers in factory assembly lines, food factories, and other machines.
The entry of PLC into the industry
Industrial automation started long before PLC. In the early to mid-1900s, automation was typically accomplished using complex electromechanical relay circuits. However, the number of relays, wires and space required to create even simple automation proved problematic. Thousands of relays were needed to automate a simple process in the factory! In 1968, the first programmable logic controller (PLC) was introduced to replace complex relay circuits in industrial plants. The PLC is designed to be programmable by plant engineers and technicians already familiar with relays and control schematics. From the beginning, PLCs were programmable using ladder logic designed to simulate control circuit circuits. Ladder diagrams are like control circuits where current flows from left to right through closed contacts to energize a relay coil.
PLC types
In terms of physical hardware, there are mainly two types of PLC:
Compact PLC or Fixed PLC: This type of PLC has a fixed number of input/output modules. The power supply, processor, and communication card are in one unit.
Modular PLC: This name itself shows that this type of PLC is made up of different modules. Input and output modules can be easily expanded by adding modules. All modules are mounted in the rack, that's why it is also called rack-mounted PLC.

What is the scan cycle and scan time?
Each PLC has a scan time and scan cycle. This takes into account the speed of the PLC. A scan cycle is a cycle in which the PLC senses inputs, executes the PLC programs, and then updates the outputs. This amount of time usually lasts about milliseconds. The amount of time the PLC takes to complete a complete cycle is called the PLC scan time.
How does PLC work?
Working with a PLC can be easily understood as a cyclical scanning method known as a scan cycle.
A PLC scan process includes the following steps:
• OS starts cycling and time monitoring.
• The CPU starts reading data from the input module and checks the status of all inputs.
• CPU execution of user program or work program with relay ladder logic or any language b
• Next, the CPU performs all internal diagnostic and communication tasks.
• According to the results of the program, it writes data to the output module so that all outputs are updated.
• This process continues until the PLC is running.
PLCs can be described as small industrial computers with modular components designed for industrial automation. The controller is almost all modern industrial automation. The PLC is designed for multiple digital and analog inputs and outputs with a wide temperature range, electrical noise resistance, as well as vibration and shock resistance. PLC consists of three basic parts:
1. Processor or CPU
2. Power supply and rack
3. Inputs and outputs
PLCs come in many shapes and sizes. These components can be small enough to even fit in your pocket while most control systems require large PLC racks. Smaller PLCs are usually designed with fixed inputs and outputs. PLC is a complex and powerful computer. But the operation of a PLC in simple words is that the PLC takes the inputs, operates on the inputs of the processor, and then turns the outputs on or off based on that logic.
How do input/output systems work?
The I/O system or the input/output system establishes a physical connection between the equipment providing information (inputs) and controllable devices (outputs) and PLC. There are different types of I/O cards that conditionally set the input or output type so that the processor can use it for logic.

It's simply a matter of determining the amount of input and output needed, filling the rack with the right cards, and then addressing them correctly in the CPU program. There are four basic steps in the operation of all PLCs, input scan, program scan, output scan, and management. These steps are continuously repeated in a loop.
Input Scan: Detects the status of all input devices connected to the PLC
Program Scan: Executes the program logic created by the user
Output Scan: Enables or disables all output devices connected to the PLC
Management: includes communicating with internal programming and troubleshooting devices.
How to write a program for a PLC?
Today, a personal computer with dedicated PLC software is used for PLC programming. This program is stored in the CPU. The program is written using a language called a programming language. These programming languages include the following:
• Ladder Diagram (LD)
• Instruction List
• Structured Text
• Function Block Diagram
• Sequential Function Charts

Read more: What is PLC? And what are its uses?