PLC programming debugging can be divided into two types: simulation debugging and on-site debugging. Before that, first carefully check the PLC external wiring, which is an important link.
Correct external wiring. To find wiring faults , you can use a pre-written test program to scan and power-on the external wiring. For safety reasons, it is best to disconnect the main circuit. Before connecting the main circuit , confirm that the wiring is correct , and send the simulated and debugged program to the user memory for debugging until the functions of each part are normal and the overall control function can be completed in a coordinated manner.
01Simulation debugging of program
After writing the designed program into the PLC (Introduction to PLC Programming and Debugging ), first check carefully one by one and correct any errors that occur during writing. User programs are usually simulated and debugged in the laboratory first. The actual input signals can be simulated with toggle switches and buttons. The on/off status of each output is displayed by the relevant light-emitting diodes on the PLC. Generally, there is no need to connect the actual load of the PLC ( Such as contactors, solenoid valves , etc.). According to the function table diagram, switches or buttons can be used at appropriate times to simulate actual feedback signals, such as the connection and disconnection of limit switch contacts. For sequential control programs, the main task of the debugger is to check whether the operation of the program complies with the requirements of the function chart, that is, when a certain conversion condition is realized, whether the correct change of the activity state of the step occurs, that is, all the preceding steps of the conversion Whether it becomes an inactive step, whether all subsequent steps become active steps, and whether the driven load of each step changes accordingly.
During debugging, various possible situations should be fully considered. The various working modes of the system, each branch in the function table diagram with a selective sequence, and various possible progress routes should be checked one by one without omission. After discovering the problem, you should promptly modify the ladder diagram and the program in the PLC until the relationship between the input quantity and the output quantity fully meets the requirements under various possible circumstances.
If the set values of some timers or counters in the program are too large, in order to shorten the debugging time, you can reduce them during debugging, and then write their actual set values after the simulation debugging is completed.
While designing and simulating the debugging program, the console or control cabinet can be designed and manufactured , and the installation and wiring of other hardware other than PLC can also be carried out at the same time.

02 On-site debugging of the program
On-site debugging of the PLC program refers to the actual debugging at the industrial site after all the equipment is installed and all the connecting lines are connected. It is also the final debugging of the PLC program. The purpose of on-site debugging is that after passing the debugging, it can be handed over to the user for use or trial operation. There are many people involved in on-site debugging, so it must be well organized and have a debugging outline. According to the outline, proceed step by step. When starting debugging, the equipment may not be running or even powered on. As the debugging progresses, you can gradually power on, start up, and load until it operates under rated conditions. The specific process is roughly:
03The process is as follows:
1) Check the wiring and address. Do it point by point and make sure it is correct. But if you don't check it with electricity, it means checking the line, which is more troublesome. It can also be checked with power on, and after adding a signal, see whether the operation of the electronic control system meets the design purpose.
2) Check the analog input and output. Check whether the input and output modules are correct and working properly. If necessary, standard instruments can also be used to check the accuracy of input and output.
3), check and test the indicator light. If there is an indicator light on the control panel, check the display of the corresponding indicator light first. On the one hand, check whether the light is broken, and on the other hand, check whether the logical relationship is correct. The indicator light is a mirror that reflects the work of the system. Adjusting it first will facilitate further debugging.
4) Check the logical relationship between manual actions and manual control. After completing the above debugging, you can then debug manual actions and manual control logic relationships. It is necessary to check the output points of each manual control to see whether there are corresponding outputs and actions corresponding to the outputs, and then see whether each manual control can be realized. If there is a problem, resolve it immediately.
04Specific process:
5), semi-automatic work. If the system can work automatically, then first adjust whether semi-automatic work can be achieved. You can proceed step by step during debugging. until the entire control cycle is completed. If there is a problem in any step or link, we will start to solve the problem in that step or link.
6), works automatically. After completing semi-automatic debugging, automatic work can be further debugged. Observe several more work cycles to ensure that the system can continue to work correctly and without error.
7) Analog debugging and parameter determination. The above debugged projects are all logic control projects. This is the first thing to adjust when debugging the system. After these debuggings are basically completed, you can start debugging analog and pulse control. The most important thing is to select appropriate control parameters. Generally speaking, this process is relatively long. You need to be patient in adjusting, and you need to make multiple choices for parameters, and then choose the best one. For some PLCs, its PID parameters can be obtained through self-tuning. However, this self-tuning process also takes a considerable amount of time to complete.
8) Check abnormal conditions and complete all the above debugging. The entire debugging is basically completed. But it's better to do some abnormal condition checks. Check if there are abnormal situations or some unavoidable illegal operations, whether there will be shutdown protection or alarm prompts
ch
English



