How to modify the Names in Input and Output tabs of the FMU block from the Command Line/API?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 23 Apr 2019
Edited: MathWorks Support Team
on 29 Apr 2021
How to modify the Names in Input and Output tabs of the FMU block from the Command Line/API?
Accepted Answer
MathWorks Support Team
on 29 Apr 2021
Edited: MathWorks Support Team
on 29 Apr 2021
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!