Replace FMU and reload it in the FMU block in Simulink
5 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I have the following problem: I have added an FMU import block to my Simulink model and imported my FMU by specifying the path of the FMU. The simulation in Simulink with the FMU works so far. However, if I make changes in the external simulation software (I am not talking about parameters that I could change directly in Simulink) and replace the existing FMU in the Matlab path with a new one (with the same name), the FMU block in Simulink do not see the changes, even though they appear in the corresponding xml file. I can still simulate with the FMU, but changes in parameter values between the two FMU files are apparently not taken into account. The changes only take effect if I delete the existing FMU block in Simulink, create a new one and load the last FMU I created.
Are the parameters in the FMU block cached somewhere that the FMU block accesses? I have already tried to update the model, but it does not help.Is there any other way, some kind of reset command for the FMU Block, to reload the stored FMU? Since I am planning to automate the simulation, I would like to avoid having to delete the FMU Block and add a new one after each new FMU is created.
Many thanks in advance!
0 个评论
回答(1 个)
Yash
2025-1-20
You can try the below commands to reset cache and path in MATLAB:
rehash toolboxcache;
rehash path;
In your script you can use set_param to set the FMU Block with the path again:
set_param(fmuBlockPath,'FMUName',pathOfFMUFile);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!