Why am I unable to import an FMU after exporting it from a Simulink project?

85 Ansichten (letzte 30 Tage)
I am able to import FMU files that come from another tool. However, when I export an FMU from a Simulink Project and I try to import it back to Simulink, the model gets stuck in the initializing stage. I also tried running the following command in the MATLAB command window:
>> shareMATLABForFMUCoSim
In this case, I got the following error message:
"Error in supplied FMU: An error occurred in function 'fmi2Instantiate' for block 'Mymodel/FMU' during simulation. To view debug logs, open FMU log file. For more information, see the FMU troubleshooting documentation."
Then, I open the FMU log file which says the following:
Debug Logging enabled for block 'MyModel/FMU'
Log from FMU: [category:logStatusError, status:fmi2Error] Cannot find available MATLAB session open for co-simulation.
Log from FMU: [category:logStatusError, status:fmi2Error] fmi2Instantiate: Cannot find or connect to existing MATLAB session.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 26 Jun. 2019
The issue is that there is not an available MATLAB session to run the co-simulation.These are the steps to resolve the issue:
1) Open a new instance of MATLAB.
2) Execute the following command in the MATLAB command window of the new MATLAB instance:
>> shareMATLABForFMUCoSim
Note: please do not run anything else in this new instance of MATLAB.
3) After importing the FMU in the first instance of MATLAB, run the model.

Weitere Antworten (0)

Kategorien

Mehr zu Create Standalone FMU finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by