One of the best tools for diagnosing issues and troubleshooting a PLC program is the PLC file S2, the Status file.
The file presentation type indicates Structured, which is the format displayed. The format can be changed to Binary, Decimal, or other formats if desired.
On the first tab, Main, the free-running clock, data item S:4 should be counting up if the CPU is running and has not halted.
While other indicators will show a faulted CPU condition, inspecting S:4 and seeing that the value is not incrementing is positive proof that the CPU had halted.
The other tabs of the S2 Status file give additional troubleshooting data, especially the Errors tab.
One of the most common errors in PLC programming is a divide by 0 error. This occurs when a variable used in a divide block is reset or initialized.
The best way to avoid a divide by zero error is to test the divisor prior to executing the DIVIDE instruction to ensure it is not equal to zero.