ControlLogix 5570 T04:C31: JSR/RET parameter count mismatch, what to check?
My ControlLogix 5570 controller just faulted with T04:C31, indicating a JSR/RET parameter count mismatch. This happened right after I made an online edit to a subroutine. What should I check first?
A ControlLogix or CompactLogix controller displays a Major Fault Type 4 Code 31 when a JSR instruction attempts to call a subroutine (SBR/RET) with fewer parameters than the subroutine expects. This fault occurs when the JSR or RET instruction executes in Run mode. The controller ignores extra parameters without faulting, so only too few parameters will trigger this specific error.
Likely causes and checks
1Subroutine parameters changed without updating all JSR calls
- Points to it
- The most common cause is that the SBR or RET instruction in a subroutine was modified to add parameters, but not all JSR instructions that call this subroutine were updated accordingly. This results in some JSR calls passing too few parameters.
- Check
- Cross-reference every JSR instruction that calls the modified subroutine and compare their parameter counts with the SBR and RET instructions of that subroutine.
2JSR instruction edited online with a missing parameter
- Points to it
- This fault can occur if a JSR instruction was edited online and one or more parameters were accidentally omitted during the edit.
- Check
- Compare the calling rung that was recently edited online with the last known good program export to identify any missing parameters.
Next check: Begin by cross-referencing all JSR instructions that call the subroutine you recently edited to ensure their parameter counts match the SBR and RET instructions.
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.