MATLAB Answers

Error in Simulink.m​essageview​er.interna​l.MsgIdToD​ataMap/add​Record - Caused by: Maximum recursion limit of 500 reached.

9 views (last 30 days)
Tarek Bos-Jabbar
Tarek Bos-Jabbar on 24 Mar 2017
Hello, I have recieved the following error message:
"Error in Simulink.messageviewer.internal.MsgIdToDataMap/addRecord
Caused by: Maximum recursion limit of 500 reached."
Or I will also (for no reason I have figured out yet) recieve
"Warning: The following error was caught while executing 'slmsgviewer' class destructor: Maximum recursion limit of 500 reached.
Error in slmsgviewer
Caused by: Maximum recursion limit of 500 reached. "
in mass on my command prompt. This occurs when I open a simulink file that has a distribution system (power system) set up. I am not running any simulations or anything yet I am simply opening the file.
I cannot find information on how this could trigger a maximum recursion limit from opening a simulink/simscape power systems file or where/what the Simulink.messageviewer.internal.MsgIdToDataMap/addRecord' is.
I have:
1) changed the blocks which are put in the system so that I know its not an issue with callbacks or initialization in the masking
2) commented out code which initializes the block parameters from the code (File is initially populated with blocks from code)
3) deleted sections of blocks to find if is a specific problem with one (its not at about 20/50 blocks the error message stops but it doesnt matter which blocks are deleted)
I do not have the first idea about what I am dealing with and despite many hours searching google, Matlab Wiki and even youtube.
The only solutions I have seen so far make no mention of this happening in a simulink/simscape file and usually advise to just increase the recursion limit. I would like to know what the issue is though to properly solve it. Any information on this will be greatly appreciated.
Thank you for your time.
  1 Comment
Pedro Beires
Pedro Beires on 17 Aug 2018
Ok the same thing happened to me, also building a distribution power system. I had not run any simulations yet. No solutions yet.
As it occured: I had the .slx opened, specifically an RLC Load Mask opened. I was going to initialize local variables via script, variables which are called by the Simulink model. I caused an error running the script because I had changed the script filename via Windows Explorer, closed and reopened the script and ran it to initalize the variables. I'm quite certain I got the first crash at that point. Afterwards, after restarting MATLAB and restarting the PC, I get the described error trying to open the Simulink file.

Sign in to comment.

Answers (3)

Jan
Jan on 1 Oct 2018
Hello, I have had the same error while creating a distribution system with simulink. I fixed the problem by creating a new empty simulink model. I have copied the distribution system (all elements) into the new model. So far the error has not recurred in the new model.

VraelEnrique
VraelEnrique on 27 Jan 2020
Did you guys could find a solution to this problem? I have the same issue and i don´t get the solution to it /:
  1 Comment
Shubhranshu Kumar Tiwary
Shubhranshu Kumar Tiwary on 8 May 2021
Before opening the model, run the following code in the command prompt
>> set(0,'RecursionLimit',5000)
Then try opening the model.

Sign in to comment.


Shubhranshu Kumar Tiwary
Shubhranshu Kumar Tiwary on 5 May 2021
I am not an expert, but I too faced a similar instance when I tried making an IEEE 57 Bus system model which was yet incomplete. When I closed MATLAB and opened it again next day I faced the same error "maximum recursion limit of 500 reached". I contacted the customer support. My problem was solved.
Solution: Before opening the model, run the following code in the command prompt
>> set(0,'RecursionLimit',5000)
Then try opening the model.

Community Treasure Hunt

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

Start Hunting!