FMU Import Script for Simulink

4 ビュー (過去 30 日間)
Aaron Darnell
Aaron Darnell 2021 年 1 月 7 日
回答済み: Mark McBroom 2021 年 1 月 17 日
I am importing an FMU into the Simulink environment using a script. The issue is that the rest of my script that sets up the environment for the user continues to run before an FMU can be uploaded. With the code below, the FMU import dialog will open, but the code does not stop. I want to avoid using an arbitrary dialog box to use with the waitfor function. Instead, is there a way to use the FMU parameters dialog box as the waitfor condition?
fmuBlock = add_block('simulink_extras/FMU Import/FMU','untitled/FMU');
load_system (fmuBlock);
open_system(fmuBlock);

採用された回答

Mark McBroom
Mark McBroom 2021 年 1 月 17 日
If you set the FMUName property then you should not get prompted. YOu can do this either by adding additional arguments to the add_block() function or call set_param after add_block as shown below.
fmuBlock = add_block('simulink_extras/FMU Import/FMU','untitled/FMU','FMUName','myFmu.fmu');
or
set_param(fmuBlock,'FMUName','myFum.fmu');

その他の回答 (0 件)

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by