Products Catalogue Home     |     About Us    |     Retrofit     |     Download     |     News     |     Tech Support     |     Contact Us     |     
ppr fittings-NF-4011-Newsun Industry Co., Ltd
Home > Tech Support >

Two important points of PLC program writing

 
The PLC application program should meet the control requirements of the controlled object to the greatest extent. After conceiving the main body of the program, it is necessary to use it as the main line to write programs that realize each control function or each subtask one by one. After continuous adjustment and improvement. Enable the program to complete the required control functions. In addition, PLC application programs should usually include the following aspects:
 
1. Initialization program After the PLC is powered on, some initialization operations are generally required. Its function is to make necessary preparations for start-up and avoid system malfunction. The main content of the initialization program is: clear certain data areas and counters; restore certain data areas to the required data; set or reset certain output quantities; display certain initial states and so on.
 
2. Signal detection, fault diagnosis, data display, equipment contact, etc. can all be reserved as routines. These contents can be added when the program design is basically completed. They can also be relatively independent blocks.
 
3. Protection and chain procedures. In various applications, protection and interlocking are indispensable parts. It can put an end to control logic confusion caused by illegal operations, and ensure safer and more reliable system operation. Therefore, we must seriously consider the issue of protection and linkage. Usually interlock and protection measures are also set outside the PLC.
 
4. PLC main program and subroutine. This is the logic and operation directly related to process control. Generally, subprograms can be classified according to space or time. It is best to allocate enough independent data storage areas or data blocks in advance for each subprogram, and program variable names are planned uniformly. Complicated places must be noted in detail. Through the process, fully collecting the equipment parameters and the demand information of the operators, can we write a set of qualified procedures that are easy to accept.
 
two
The quality of the PLC program
 
For the same control requirement, even if the same type of PLC is selected, the structure of the program written with different design methods may be different. Although several programs can achieve the same control function, the quality of the programs may vary greatly. The quality of the program can be measured by the following aspects:
 
1. The correctness of the procedure:
 
The most fundamental aspect of an application is correct. The so-called correct program must be able to withstand the test of system operation practice. It is meaningless to leave this article to evaluate the program.
 
2. The reliability of the program is good:
 
A good application program can ensure that the system can operate safely and reliably under normal and abnormal (short-term power failure and re-power, some controlled quantities exceed the standard, a certain link failure, etc.) Illegal operation (such as pressing or accidentally touching a button that should not be operated) will not cause system control errors.
 
3. The parameters are easy to adjust:
 
One of the advantages of PLC control is that it is flexible, and it is easy to change certain functions of the system by modifying the program or parameters. For example, some systems need to change certain control parameters under certain circumstances (such as timers or counter settings, etc.). When designing a program, you must consider how to write so that it can be easily modified.
 
4. The procedure should be concise:
 
The written program should be as concise as possible, reduce the statement of the program, generally can reduce the scanning time of the program, and improve the response speed of the PLC to the input signal. Of course, if you use too many instructions with a longer execution time, sometimes although the program has fewer statements, its execution time is not necessarily short.
 
5. The readability of the program is good:
 
The program is not only shown to the designer, but also read by the maintainer of the system. In addition, in order to facilitate communication, the program is also required to be readable.

—[Close]— —[ Back]— —[ Print]—