Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000) fault T04:C20: Program fault: array subscript too large, or CONTROL POS/LEN invalid
An array subscript was too large for the array, or the .POS or .LEN value of a CONTROL structure (used by FIFO, file and sequencer instructions) was invalid. Rockwell’s corrective action: adjust the value to be within the valid range and do not exceed the array size or its defined dimensions.
Diagnose this with AI
Try Free PLC Fault Diagnostic Upload a keypad photo, the fault history or a parameter export from your Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000). InduQT compares the evidence and suggests the next useful checks.
When it happens
- In Run, when an indirect index reaches a value outside the array
- At the change to Run (prescan), on controllers before revision 13
Likely causes and checks
1Indirect index computed or incremented past the array bounds
- Points to it
- Fault in logic that uses a tag as a subscript, e.g. Array[Index]; index value at or above the array length, or negative.
- Check
- Read the index tag value at the fault and compare it with the array dimension; add a limit check before the access.
2CONTROL structure .LEN larger than the array, or .POS out of range
- Points to it
- Fault on FFL/FFU, COP-like file or sequencer instructions using a CONTROL tag.
- Check
- Compare .LEN and .POS with the size of the array the instruction addresses.
3Index set from outside the program (HMI, recipe, message) without validation
- Points to it
- Fault follows an operator or recipe entry.
- Check
- Trace where the index tag is written and limit-check it at the point of entry.
Telling it apart
- T04:C21 is the separate code for CONTROL .LEN or .POS less than 0; T04:C83 is a value out of range with Boolean arrays and bit-level addressing.
- From revision 13.0 the controller automatically clears array-subscript faults during prescan (an internal handler clears Type 4 Codes 20 and 83 in prescan only); a fault at the change to Run on revision 11.x or earlier points to prescan.
- If a fault routine clears the fault, the faulted instruction does not run and execution continues with the next one; data the instruction should have written is not updated.
Evidence to collect
- Major Faults tab screenshot (program, routine and rung information)
- Value of the index tag and array dimension at the fault
- Program export (L5X) of the routine
- HMI or recipe entries just before the fault
- Controller firmware revision
Work on fuel trains, burners, pressure vessels and electrical equipment must be done by qualified personnel following the manufacturer’s documentation and local codes. Never bypass a safety device or interlock.
Related
- Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000) T04:C31: Program fault: JSR/RET parameter count mismatch
- Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000) T04:C34: Program fault: timer with a negative PRE or ACC
- Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000) T04:C83: Program fault: value out of range
- All Rockwell Automation / Allen-Bradley ControlLogix / CompactLogix (Logix 5000) fault codes