Applicable Systems
Modicon M221
Modicon M241
Modicon M251
Modicon M340
Modicon M580
Altivar
Symptoms
The PLC STATUS LED turns orange or red. The controller reports an exception stop. The application has been stopped due to an exception condition, not a standard fault.
Possible Causes
- User code generated an exception (e.g., division by zero)
- Array access out of bounds in user code
- Null pointer dereference in user code
- Type conversion error in user logic
Troubleshooting Steps
- Step 1: Read the exception details in SoMachine Basic diagnostics
Identify the specific exception type and the POU where it occurred - Step 2: Open the identified POU and review the code at the exception point
Locate the instruction causing the exception - Step 3: Fix the code by adding bounds checking or null checks
Code executes without generating exceptions - Step 4: Download the corrected application and restart
Application runs without exception stops
How to Reset
To reset: 1) Fix the code causing the exception. 2) Download the corrected application. 3) Restart the application. 4) Clear the exception. Caution: Exception stops indicate programming bugs that should be fixed, not ignored.
Frequently Asked Questions
- Q: What is an exception stop on a Modicon M221?
An exception stop occurs when the application encounters a runtime error such as division by zero or array out of bounds. The controller stops the application to prevent undefined behavior.
- Q: How do I prevent exception stops?
Add bounds checking to array accesses, check for zero before division, validate pointers before dereferencing, and use type-safe operations in user code.
Source: Schneider Electric Modicon M221 Programming Guide, 2023
Category: PLC & VFD