MATLAB Answers

Simulink failed assertion: object[id] != NULL

175 views (last 30 days)
Michele Martini
Michele Martini on 24 Aug 2016
Answered: Dixon Devasia on 20 Jan 2021
Hi everybody, I built a Simulink model which contains conventional blocks (integrators, sums, divisions) and a PM Synchronous Machine block (Simscape/Power Systems/Specialized Technology/Fundamental Blocks/Machines). When running the model, I get the following error:
failed assertion in b:\matlab\toolbox\stateflow\src\stateflow\utils\object.cpp at line 2514:
object[id] != NULL
[ 0] 0x00000001402c487a C:\Program Files\MATLAB\R2016a\bin\win64\stateflow.dll+02705530 CGXE::JITMgr::JITMgr+00007674
[ 1] 0x0000000140ee4b2e C:\Program Files\MATLAB\R2016a\bin\win64\stateflow.dll+15420206 SF::mx2str_write_str+00031470
MATLAB stack trace:
> In get_sf_block_port_info (line 21)
In SCRIPT_SimHydro (line 229)
Error using SCRIPT_SimHydro (line 229)
object[id] != NULL
Where "SCRIPT_SymHidro" is the script I am using to run the Simulink model. I personally never had a similar problem, though I have been using Simulink for few years now.
Other details about my Matlab/OS: MATLAB Version: (R2016a). Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1). Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode.
Any help would be really appreciated.

Answers (4)

Shota Kato
Shota Kato on 12 Aug 2018
I had the same problem but could solve the problem by reworking "MATLAB Funciton" used in a Simulink model.
I checked the "MATLAB Function" used in Simulink, but I could not refer to the function. (The function was not displayed in the editor when double-clicked) When "MATLAB Function" was reworked, no error occurred.
I don't understand where the Simulink program is stored, but this error is supposed to be output when there is something that can not be referenced in the block used in Simulink.
My Matlab/OS : (R2017b) / Mac OS High Sierra 10.13.6 and (R2018a) / Windows 10 Pro version 1803
  1 Comment
Alexander Scholz
Alexander Scholz on 15 May 2019
Thanks a lot, it worked for me.
It was a corrupted "MATLAB Function" Block, even though I hadn't touched it for a very long time. I just copied it from a previous version and the error was gone.

Sign in to comment.

Kubum Cho
Kubum Cho on 26 Feb 2019
I got a same problem, and i solve this problem.
'failed assertion in b:\matlab\toolbox\stateflow\src\stateflow\utils\object.cpp at line 2514:'
This means your simulink file have a problem in stateflow block.
And you can find stateflow block that have problem to mark break point in 'get_sf_block_port_info (line 21)'
If you mark break point, you can find block path in workspace.
And then you can solve this problem to replace or delete stateflow block.

Ravi S Tiwari
Ravi S Tiwari on 9 Dec 2019
getting errorin using ovecurrent relay model. error is object[id]!=NULL, why it is comming any one please help.

Dixon Devasia
Dixon Devasia on 20 Jan 2021
Restarting Matlab Helped me solve the problem!

Community Treasure Hunt

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

Start Hunting!