Share this

A Brief Analysis of the Relationship Between PLC and Microcontroller

2026-04-06 08:09:09 · · #1

A PLC, or Programmable Logic Controller, uses a programmable memory to store programs, execute user-oriented instructions such as logic operations, sequential control, timing, counting, and arithmetic operations, and control various types of machinery or production processes through digital or analog inputs and outputs.

A programmable logic controller (PLC) is essentially a computer specifically designed for industrial control, and its hardware structure is basically the same as that of a microcomputer. It consists of a power supply, a central processing unit (CPU), memory, input/output interface circuits, functional modules, and a communication module .

Once a programmable logic controller (PLC) is put into operation, its operation generally consists of three stages: input sampling, user program execution, and output refresh. Completion of these three stages is called a scan cycle. Throughout the entire operation, the PLC's CPU repeatedly executes these three stages at a certain scan rate.

microcontroller

A microcontroller is an integrated circuit chip that uses very large-scale integrated circuit (VLSI) technology to integrate a central processing unit (CPU) with data processing capabilities, random access memory (RAM), read-only memory (ROM), various I/O ports and interrupt systems, timers/counters, and other functions (and possibly display driver circuits, pulse modulation circuits, analog multiplexers, A/D converters, etc.) onto a single silicon chip, forming a small but complete microcomputer system. It is widely used in industrial control. In the 1980s, it evolved from the four-bit and eight-bit microcontrollers of the time to today's high-speed 300MHz microcontrollers.

PLCs are currently largely made using single-chip microcomputers. PLC is an application of single-chip microcomputers in relay control systems. Personally, I feel that PLCs are more suitable for use in harsh industrial environments and are more stable, while single-chip microcomputers have higher requirements for the working environment.

PLC is a type of product developed using a microcontroller.

Using microcontrollers has many limitations. First, you need to learn C, how to design PCBs, digital and analog circuits, and constantly debug. Then what? You need to produce them. If you only need to produce a few sets, you need to solder them manually, which is inefficient. If you need to produce a large number, you need testing and maintenance equipment and personnel. From project initiation to market launch, it can take anywhere from a few months to several years.

PLC program

Based on microcontrollers, programming is simplified by using ladder diagrams and simple commands instead of C language, so you don't need to learn C to use it. PLCs, on the other hand, require an interpreted language like Python, which reads a command, interprets it, and executes it as a string of equivalent C code.

I'll use a code similar to Mitsubishi PLC to explain it. Yes, it's an endless series of cases, each case interpreting one command. For example, when temp5=0x42, it means the AND command in the Mitsubishi PLC. This is the explanation from the Mitsubishi PLC programming manual.

Executing the AND function causes the program pointer to increment, similar to the PC in a microcontroller.

Commands are mostly executed using a state mechanism, where new states are written to a specified position in an array, data is read periodically, and external levels are updated. These are the three functions in the main function: refresh output, refresh input, and interpret the next tone language.

Refreshing the output means reading the state of the corresponding output position in the array.

Input involves writing the read input state data in_x into the specified position of the array.

The update function of in_x is the input filtering function.

The above is the process of converting a PLC to a C.

PLC ladder diagrams are so much more convenient than alphabetic programming! Intuitive and concise.

The purpose of PLC is to make up for the shortcomings of microcontroller. PLC uses ladder diagrams and encapsulates C to simplify programming, making it easy to get started.

Read next

CATDOLL Nanako Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22
CATDOLL 146CM Vivian TPE

CATDOLL 146CM Vivian TPE

Articles
2026-02-22
CATDOLL 133CM Ingrid Shota Doll

CATDOLL 133CM Ingrid Shota Doll

Articles
2026-02-22