Thread Content
The scientific steps for PLC programming are actually quite simple, but most engineers tend to overlook many details just because they consider it simple. Ignoring details will inevitably lead to problems in the future. To avoid problems in the future, it is necessary to follow the rules carefully; without rules, nothing can be organized properly. PLC programming also has its own set of rules. Step 1: Read the product manual. Reading the product manual seems extremely simple, but many engineers fail to do it. They consider this step to be a waste of time, and even decide to learn about the equipment only through training provided by the supplier. Reading the instructions carefully is the first step in programming. First, one must read the safety guidelines to find out which actuators may cause harm to people, which ones are most likely to collide with each other, and how to handle dangerous situations. All of these critical issues are outlined in the safety guidelines – so why not take the time to read them? Furthermore, the specifications of each component of the equipment, as well as its usage and debugging methods, are also included in the manual. Without reading this information, even if the program is correct, the equipment will not function properly if the components have not been properly debugged. Furthermore, all the circuit diagrams, control circuit diagrams, and assembly diagrams are also included in the manual; without reading it, how can one know what modifications can be made to each component? Step 2: According to the instructions, check the I/O, commonly known as “making marks”. There are many ways to check I/O, but it is essential to carry out the checks in sequence using the addresses provided in the manual, and only when it is absolutely safe to do so. When checking the input points, the input signals generally consist of various sensors, such as capacitive, inductive, photoelectric, piezoresistive, ultrasonic, magnetic, and limit switch sensors. Checking these components is simple: according to the component instructions, place the workpiece in the designated position, or move the actuator to check whether the sensor is generating a signal. Of course, different devices may use different methods for detection, depending on the specific circumstances. But one must be especially careful when checking the output signal. In the case of electrically driven products, it is necessary to supply power to the actuator’s driver under safe conditions, especially ensuring that the device will not experience any collisions, in order to check whether the actuator can move. In the case of hydraulic or pneumatic actuators, the directional control valve is also manually energized under safe conditions in order to control the actuator. When checking the output signals, regardless of the driving method used for the actuator, it is essential to follow the instructions provided with the components in order to ensure the safety of both the equipment and personnel. It should be noted that not all actuators of equipment can be tested by applying power; therefore, sometimes individual output signals may not be available for manual testing. Whether it is an input or output device, when the sensor generates a signal or the actuator’s driving mechanism is powered on, it is necessary to check at the same time whether the indicator lights on the PLC’s I/O module are also lit. In many devices, the input and output signals are connected to the PLC via terminal blocks. Sometimes the indicator lights on these terminal blocks show a signal, but this does not guarantee that the corresponding address on the PLC will have a signal connected due to an internal break in the wiring. Special attention should be paid to this. After measuring the input and output signals, the measured addresses must also be recorded to ensure that the signal addresses match those specified in the manual. If there is a discrepancy, measure the device address again; if the results remain inconsistent after multiple measurements, contact the device manufacturer first, as it cannot be guaranteed that the address provided by the manufacturer is correct. Step 3: Open the programming software, configure the hardware, and enter the I/O addresses in the symbol table. Different PLCs use different programming software. However, for any software, the first step before programming is hardware configuration, which involves setting up the hardware settings and the corresponding communication parameters based on the actual type of PLC. After the hardware configuration is completed, write the I/O addresses that were previously recorded on paper into the software’s symbol table. Due to differences in software, the definition of the symbol table may vary, but most software has this feature, and this step is crucial. When creating the symbol table, it is important not only to enter the absolute addresses of the device’s inputs and outputs correctly, but it is also advisable to give each address a name and add comments; this will be very convenient for subsequent programming. There is no need to query the absolute address every time while programming; simply enter the named identifier. Of course, it also depends on whether the software has this feature. Step 4: Draw the program flowchart. Before programming, it is essential to draw a flowchart of the program on paper first. A complete program should include a main program, a shutdown program, an emergency stop program, a reset program, and so on. If the software permits, these various programs should be written in the form of \"blocks\" – each program being one such block – with each block then being called as needed. What PLCs are best at is handling sequential control, in which the main process is the core element; it is essential to ensure that the established process is correct, and careful checks should be carried out on the draft. If there is a problem with the main process, collisions are likely to occur when the program is executed by the PLC, which can damage the equipment or pose a risk to human safety. Step 5: Write the program in the software. Once it has been confirmed that the main workflow is working properly, the program can be written in the software. In addition, attention must be paid to the correctness of the stop, emergency stop, and reset procedures, especially the stop and emergency stop procedures, which are the most important ones related to personal safety and equipment safety and must not be taken lightly. It is essential to ensure that under any circumstances, whenever a stop or emergency stop procedure is initiated, the equipment will never cause harm to anyone. The user program of a PLC is designed by engineers in accordance with the process control requirements of the control system, using the PLC programming language. The standard for industrial control programming languages established by the International Electrotechnical Commission (IEC1131-3) classifies PLC programming languages into Ladder Diagram language (LD), Instruction List language (IL), Function Block Diagram language (FBD), Sequential Function Chart language (SFC), and Structured Text language (ST). PLC programming technicians should be proficient in one or more of these five programming languages. Step 6: Debugging the program. In this step of debugging, it can be divided into two aspects: 1. If conditions permit, or if you have excellent logical skills, you can first use the software’s simulation function for testing; however, many complex programs are difficult to verify for correctness using software simulation. 2. Download the program to the PLC for online debugging. If the device does not move or abnormalities occur during operation, do not try to modify the program first; it is likely that the sensors have not been properly calibrated. Only after confirming that the sensors are correct should you proceed to modify the program. Step 7: After debugging is complete, edit the program again. During the debugging in the previous step, changes were made to the program; therefore it is necessary to review or edit the program as a whole once more, and then upload the final version of the program to the PLC. Step 8: Save the program. In this step, one thing to keep in mind is where the program should be saved PC hard drive? Flash memory device? External hard drive? Of course, none of these are acceptable; all of these storage devices can be infected with viruses. Therefore, it is necessary and only possible to burn the program onto a CD. And there is another issue: which program is used for the firing process? Previously, we have already downloaded the program that has been finally debugged and modified to the PLC. If the PLC runs this program without any issues, then the program is uploaded to the PC and burned onto a disk. All of the above is for safety. Step 9: Fill out the report. After completing the programming, it is necessary to fill out the final debugging report, documenting all the problems encountered as well as the various difficulties faced during the programming process. Because over time, one will also forget certain techniques related to the programs, and it also makes it easier for other colleagues to understand the programs you have written.