How to modify the Names in Input and Output tabs of the FMU block from the Command Line/API?
11 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 4 月 23 日
編集済み: MathWorks Support Team
2021 年 4 月 29 日
How to modify the Names in Input and Output tabs of the FMU block from the Command Line/API?
採用された回答
MathWorks Support Team
2021 年 4 月 29 日
編集済み: MathWorks Support Team
2021 年 4 月 29 日
The name fields listed under the "Input" and "Output" tabs cannot be changed via the Command Line/an API method for the FMU file itself. The FMU block takes the names of the signals within the buses fed into the block and they are baked in at the time the FMU block is created. The FMU block must be fed the buses that appear in the Input and Output tabs.
Since it is possible to change this in the FMU block mask for the Simulink instance, you can use the following API to change it in the mask:
To get the actual information, use this command:
get_param(gcb, 'FMUOutputBusObjectName')
and you can set it with:
set_param(gcb, 'FMUOutputBusObjectName',{'testBusName'})
where you have to use this Cell syntax, otherwise it shows:
"Invalid FMU output bus object name format for block 'fmudemo_vehicAOB/vehicAOB'. Bus object names must be in a cell array format. For example: {'BusOutType1', 'BusOutType2'}."
To query the input data use:
'FMUInputBusObjectName'
in the above get_param call.
Please be aware that this API can change in the future.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!