Stateflow fails to compile after calling Simulink from a Matlab script

조회 수: 4 (최근 30일)
Stefan
Stefan 2013년 10월 11일
답변: samir samir 2016년 7월 20일
I am trying to run a fairly complex hybrid vehicle model in Simulink, using Matlab2012b. The model has always worked fine until now. Today I created a Matlab script to call the model, run its initialization file, run the model, and gather some data for post-processing. This script ran successfully, once. On the second execution, Simulink failed to run, with the following error messages: Coder Error - unknown - Stateflow - Failed to create file: "model path".h Model error - unknown - Simulink - error using sf, error using construct_error(line 108), failed to create file: "...path and name...".h
What's more, when I try to run the model just in Simulink, it gives the same error. Normal, Accelerator, Rapid Accelerator give the same error. I tried the usual troubleshooting steps (restarts, mex -setup, clearing out slprj and mex32 files), and I re-installed the c++ compiler. Same error. I have tried running Matlab as administrator, and different versions of Matlab. Same error. It's like this model is set to no longer compile correctly.
I can run Matlab scripts and other Simulink models just fine. I have searched the forums and tried the other suggested solutions, but it hasn't fixed the problem. Any ideas out there??

채택된 답변

Zack Peters
Zack Peters 2013년 10월 25일
Hi Stefan,
This is just a guess at this point but it could be possible that your path names are too long. The Windows maximum path length is 260 Characters. Is the model in a directory with a long filename or is the model name itself quite long?
If so then try renaming the model to a shorter name and move it into a directory with a shorter path name.
~Zack
  댓글 수: 1
Stefan
Stefan 2013년 11월 6일
Wow! I never saw any error or warning messages to this effect, but I renamed everything to be as short as possible, and suddenly everything works again. Well done sir!
I think this came about, in part, as the result of version control. We kept appending numbers and codes to the names over the course of development, and I guess we hit the limit. I didn't know about the Windows character limit , good to know.
Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

samir samir
samir samir 2016년 7월 20일
hello stefan,
I myself am currently designing a model of hybrid vehicle on Simulink matlab 2009
can you help me?
I arrived at the coupling phase.
I do not know how to continue?
I have designed vector control of the electric motor.
I modeled the battery, the chopper, the rectifier, the engine, the generatrice.
the rest I do not know how to combine these blocks via a DC bus and especially I have used a state flow control, (I'm beginner of stateflow) to simulate the states of this vehicle: stop startup, acceleration, braking (charging the battery ... etc).
at least is what you can advise me documentation for methodology forward to continue my project?
cordially. samir.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by