What is the reason for the error "Maximum Recursion limit of 500 reached" ?

I am using SimPowerSystems toolbox. The model bulit has many Battery blocks (72). Whenever I open the model, the following error is repeatedly shown in the Command Window. "Maximum recursion limit of 500 reached. USe set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer" "Error in slmsgviewer.processRecord"

Answers (2)

Usually, this is because you unintentionally have a function that is calling itself, resulting in an infinite recursion. MATLAB terminates recursion after RecursionLimit iterations.

2 Comments

Usually it's because the programmer is missing if..end statement needed by the function to decide if it should continue to call itself. That's assuming the recursion is intentional to begin with.

Sign in to comment.

Placed the powergui block in the top level of all diagrams and got the issue solved

1 Comment

Hello Bela, what does the top level means ? like keeping the powergui on the above all the model blocks ?

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 19 Apr 2018

Edited:

on 3 Feb 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!