PLCs have comprehensive self-diagnostic capabilities. In case of a fault, the self-diagnostic program can easily locate the faulty component, and replacement will restore normal operation. Troubleshooting methods can be found in the troubleshooting guide of the S7-200 system manual. Practice has shown that the failure rate of external devices is much higher than that of PLCs, and when these devices fail, the PLC does not automatically shut down, potentially expanding the scope of the fault. To detect faults promptly, ladder logic programs can be used for self-diagnosis and self-handling of faults.
1. Timeout detection
The time required for each step of the mechanical equipment operation remains relatively constant. Therefore, time can be used as a reference. When the programmable controller sends a signal and the corresponding external actuator begins to operate, a timer is started to begin timing. The timer's set value is approximately 20% longer than the normal duration of the action. For example, if an actuator normally operates for 10 seconds before triggering a limit switch and sending a signal indicating the end of the action, a timer with a set value of 12 seconds is started when the actuator begins to operate. If the signal indicating the end of the action is not received after 12 seconds, a fault signal is sent through the timer's normally open contact. This signal stops the normal program and initiates the alarm and fault display program, allowing operators and maintenance personnel to quickly identify the type of fault and take timely measures to troubleshoot it.
2. Logical error checking
When the system is running normally, there are definite relationships between the input and output signals of the PLC and the internal signals (such as the state of the memory). If an abnormal logic signal appears, it indicates that a fault has occurred.
Therefore, abnormal logic relationships for some common faults can be programmed. Once an abnormal logic relationship is in the ON state, it should be handled as a fault. For example, if two limit switches are activated sequentially during mechanical movement, these two signals will not be connected simultaneously. If they are connected simultaneously, it indicates that at least one limit switch is stuck, and the machine should be stopped for handling. In the ladder diagram,
By connecting the normally open contacts of the memory bits corresponding to these two limit switches in series, a memory bit indicating a limit switch fault can be driven for detection.