This is very helpful. Now I have a handle on the situation with rebooting in PROGRAM mode. I'll reset DST385 before it reaches 10.
About the Modbus comms timer: The problematic Modbus line is returning data for multiple days and then it drops out for multiple days, this is not periodic. What is the Modbus comms timer doing? What would cause it to overflow? Can I view the contents of the timer?
About the hardware watchdog: How do I figure out what causes the CPU to not "pet" the watchdog?
I have no idea what's failing...yet. Working now to build the test cases to hopefully to catch it. The interesting point (to me) is the failure interval perfectly aligns with the system millisecond timer. That isn't a Modbus thing, that's system wide, but I suspect the lockup is due to some communication code (possibly the TCP/IP stack). This ~50 day clue is a big help for identifying the issue.
The CPU doesn't pet the watchdog because it's stuck somewhere in a loop that shouldn't take much time, but is. There is nothing you can do about it. We have to find and fix the bug.
As for monitoring the system timer, yes you can. It's the value that's reported by TICKms() in the MATH box. The lockup appears to be happening about an hour after it rolls over from 0xFFFFFFFF to zero. The rollover interval is 49.6 days, but your failure is happening at about 49.8 days.
If you are ok with it, it might be good to get your program. You can send it to support at hosteng.com.