I have personally experienced this issue ..
What Compact Logix PLC and revision? Do you have an Analog Input Module such as an IT6 ?
Do you have a power up routine ?
Do you have a separate fault handling routine?
Yes it matters .. certain things happen in the processor when these routines are present.. especially wacky powerup routines – they are not as simple as hey it runs at power up.. when a routine is present regardless if it really runs or not the processor does some things differently that it would not , unfortunately I don’t remember the specific details.
You might have a fault that is clearing by itself when it goes offline (or code in a fault routine doing this ??) – you don’t mention if you have any minor or major faults occurring …
One of the things that would be nice to capture is what system is operating at the time of this situation. So depending on how many inputs / outputs you have, you might add a routine that allows you to see what inputs and outputs are triggered just prior and at the time the processor goes offline. Store and rotate in an array of 100 bits or so with a time stamp.
We really need more information in order to provide the best help.
I suspect a bad power supply or a sensor / output being shorted at a particular time. I can’t be certain because compact logix goes offline is extremely limited information.
Provide some detail : Fault Routine Yes/ No .
If yes does it clear major faults ? Cycle to offline at that point ?
Fault Codes Majors or Minors Yes / No
Is a power up routine present – and Clearing Majors and the processor comes up in offline mode ?
If yes does it clear major faults ? Come up offline at that point
There is a lot that can be happening here ..