A good PLC program typically needs to possess the following characteristics: simplicity, readability, correctness, reliability, ease of modification, extensibility, a complete alarm system, and convenient program simulation. Although these characteristics may manifest differently across various industries and processes, their core ideas remain the same. Today, we will discuss PLC programming standards!
1. Simplicity
Make the PLC program as simple as possible. Simplicity means using standardized program frameworks and simple instructions whenever possible.
To achieve simplicity, one should optimize the program structure on a larger scale by using flow control instructions to simplify the program, and on a smaller scale, replace single-function instructions with more powerful ones, while also paying attention to the order of instruction arrangement.
2. Readability
The designed program must have good readability. This not only facilitates the designer’s understanding of the program and debugging but also makes it easier for others to read and maintain the program. If necessary, it can also promote the program.
To enhance readability, the designed program should be as clear as possible. Attention should be paid to hierarchy, achieving modularity, and using object-oriented design methods. Standard designs should be utilized as much as possible.
In special cases where language programming is used, ladder diagram programming should be preferred for ease of reading.
Moreover, I/O allocation should be systematic for easier memorization and understanding. If necessary, comments should be added. The use of internal components should also follow a systematic approach, avoiding arbitrary usage.
Readability should be considered from the beginning of program design. This is not easy to achieve completely. During the debugging process, the addition or removal of instructions and changes in the use of internal components may make an originally clear program somewhat chaotic. Therefore, it is advisable to leave some room for adjustments during design, and after debugging, to tidy up the program, thus enhancing its quality.
Program comments should at least cover the following aspects:
A. System comments: Copyright company of the entire program and its intended use.
B. Program block comments: Main purpose of this program block and its author.
C. Segment comments: Purpose of this segment of code.
D. Variable comments: Importance is self-evident, including I/O comments and intermediate variable comments.

Regarding confidentiality considerations, I believe that encryption algorithms or block encryption should be considered, rather than using reduced comments as a clever workaround.
3. Correctness
The PLC program must be correct and verified through actual work to prove its ability to function correctly. This is the most fundamental requirement for PLC programs; if this cannot be achieved, then nothing else matters.
To ensure correctness, instructions must be used accurately, and internal components must be used correctly. Accurate use of instructions is linked to a clear understanding of their meanings and usage conditions. If necessary, small programs can be written to test unclear instructions.
For the same instruction, due to differences in production batches or series models of PLCs, some instruction details may vary, so programming manuals should be consulted carefully.
Correct use of internal components is also crucial. For instance, some PLCs have power-off protection while others do not. It is essential to use power-off protection components where required, and conversely, not to use them where they are not needed.
In summary, accurate use of instructions and correct use of internal components are fundamental requirements for ensuring that the programmed PLC operates correctly.
For example, Siemens’ rising and falling edges require the use of variables with memory functions as intermediate variables, such as M points or DB points; using the FC’s temp variable would cause issues.
4. Reliability
The program must not only be correct but also reliable. Reliability reflects the stability of the PLC program, which is also a basic requirement for PLC programs.
Some PLC programs may work correctly under normal working conditions or legal operations, but fail to function properly under abnormal conditions (such as temporary power outages followed by quick restoration) or illegal operations (such as pressing buttons out of order or pressing several buttons simultaneously). Such programs are not very reliable or stable, indicating poor quality.
A good PLC program can recognize abnormal working conditions and connect them back to normal conditions, allowing the program to adapt to various situations. A good PLC program can reject illegal operations without leaving any “traces” and only accepts legal operations.
Interlocking is a common method to reject illegal operations, often used in relay circuits, and PLCs can inherit this method.
5. Ease of Modification
The program should be easy to modify.
One of the characteristics of PLCs is their convenience, allowing flexible adaptation to various situations. This is achieved through modifications or redesigning of the program.
Redesigning the program is necessary when changing the PLC’s process requirements, which involves not only recompiling the program but also reallocating I/O. In most cases, recompiling is not necessary; minor modifications will suffice. This requires the program to be flexible and easy to modify.
Ease of modification also implies elasticity, meaning that only minor changes are needed to achieve the desired parameter changes or action modifications.
6. Extensibility
Many programs may be completed before arriving on-site, but additional programs may need to be added once on-site. To avoid disrupting the overall system structure, it is necessary to reserve some space in each functional area as a backup.
Hardware should have sufficient margins, and software should consider manual, automatic, and semi-automatic operations, leaving appropriate positions available.
7. Complete Alarm System
PLC systems are often used in industrial environments, where every incident can cause varying degrees of loss. To ensure preemptive handling of accidents or to minimize losses during incidents, it is essential to emphasize the alarm and protection features of PLCs, making them a crucial component of the system.
8. Program Simulation
To ensure the progress of on-site debugging or to demonstrate to clients, it is often necessary to conduct full automatic simulations of the program before arriving on-site. This requires incorporating simulation parts into the program, which are disconnected after normal on-site operation. To enable simulation functionality, the following tasks must be completed:
(1) Convert the actual PLC I/O points into intermediate variables or data block variables;
(2) Write simulation programs for each device according to process requirements.
A program that meets the above requirements during the design process can be considered a good program.
After understanding the PLC programming standards, how can they be applied in practice? Below are some programming standards from large enterprises for your learning and reference!
1. CATL Version




















2. Mitsubishi GXWORK3 Programming Standards: KUKA Version


















3. Siemens TIA Portal Programming Standards Guide


Disclaimer: This article is reprinted from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact us promptly for deletion. Thank you!