What Happened
During program maintenance on a Schneider M580 using Control Expert (CE) 16.0, unused Derived Function Blocks (DFBs) were cleared from the project. The result: the PLC halted.
Why It Happens
Even if a DFB appears unused in the program — no instances called anywhere in the logic — the PLC memory allocation may still reference it. CE16 handles DFB memory management differently than earlier versions. Removing a DFB that the runtime believes is allocated can corrupt the memory map, causing the controller to fault and halt.
How to Avoid This
- Do not delete DFBs from a running program without a full build and download plan. Treat DFB removal the same as a structural change.
- Before removing any DFB, do a cross-reference search — check for instances, indirect calls, and references in other DFBs.
- After removing DFBs, perform a full rebuild of the project (not just an incremental build) to force memory reallocation.
- Test the modified program on a simulator or backup PLC before downloading to the production controller.
- Have a known-good backup of the program ready to restore if the PLC halts.
Recovery
If the PLC halts, you will need to download the previous working program. If no backup is available, you may need to rebuild memory allocation by doing a full download of the current (cleaned) project — but this requires the PLC to be stopped and restarted, which means process downtime.