ControlLogix 5570 T04:C20: Invalid Array Subscript in Run, what to check?
My ControlLogix 5570 controller just faulted with T04:C20, 'Invalid Array Subscript', while in Run mode. The machine stopped unexpectedly. What should I look at first to troubleshoot this?
A ControlLogix or CompactLogix controller displaying a Major Fault T04:C20 indicates a program fault where an array subscript was too large for the array, or the .POS or .LEN value of a CONTROL structure was invalid. This typically happens in Run mode when an indirect index exceeds array bounds. The controller's internal handler clears these faults during prescan on revision 13.0 and later, but they can still occur in Run.
Likely causes and checks
1Indirect index computed or incremented past the array bounds
- Points to it
- A tag used as an array subscript (e.g., Array[Index]) has a value that is at or above the array's defined length, or is negative.
- Check
- Read the value of the index tag at the time of the fault and compare it with the dimensions of the array it is accessing. Consider adding a limit check in the logic before the array access.
2CONTROL structure .LEN larger than the array, or .POS out of range
- Points to it
- Instructions like FFL/FFU, COP-like file, or sequencer instructions using a CONTROL tag have a .LEN value that exceeds the array size, or a .POS value that is outside the valid range.
- Check
- Compare the .LEN and .POS values of the CONTROL tag with the size of the array that the instruction is addressing.
3Index set from outside the program without validation
- Points to it
- The index tag's value is being written by an external source, such as an HMI, recipe, or message, without proper validation to ensure it stays within array bounds.
- Check
- Trace where the index tag is being written from external sources and implement a limit check at the point of entry to prevent invalid values.
Next check: After checking the index tag value and CONTROL structure parameters, review the program logic for any indirect addressing or CONTROL tag usage that could lead to values exceeding array bounds or becoming invalid.
Related questions
Describe the fault or upload a photo, and InduQT checks it against the manufacturer manuals. Share the result here when it helps someone else.