export FMU of Supplier Blackbox Simulink model

4 visualizzazioni (ultimi 30 giorni)
BasicKnowledge
BasicKnowledge il 10 Nov 2020
Risposto: Yash il 24 Set 2024
Hi,
I am looking to convert a black box Simulink model provided to me by a supplier to an FMU. I need to convert from a .slx file to an FMU format to enable it to be used in a third party software.
My knowledge of Matlab is very basic, but I have tried, unsuccessfully, converting using the following methods:
I suppose the fundemental question is whether it is even possible to convert a black box simulink model? as the error I get relates to the S-Function block i do not have access to:
Error in S-function 'name' : S-function 'Subsystem_sf' does not exist
ADDITIONAL INFO: I have touched base with supplier, who has initially told me that they are unable to convert the model to FMU for me. I am unsure why.
I have successfully embedded my third party model into Simulink and can Co-Simulate. However,moving forward it would be a lot more practical to use my third party software as the master, as I do not envisage modifying the Supplier model but will be heavily modifying my own model
Thanks

Risposte (1)

Yash
Yash il 24 Set 2024
As for your fundamental question, yes it is possible to export a Simulink model as a Standalone FMU. There are two ways to export a Simulink model containing S-Function block as a Standalone FMU:
1) By directly exporting the Simulink model via either
1.1) Command Line Interface - exportToFMU2CS (since R2020a, to be deprecated) or exportToFMU (since R20203b, preferred command)
1.2) GUI - Save > Standalone FMU in Simulink
Do ensure that the source code of the S-Function block is on MATLAB path so that Simulink can access it. Refer to this MATLAB Answer for more info: https://www.mathworks.com/matlabcentral/answers/826290-how-to-export-simulink-model-which-contains-s-function-block-mex-file-to-stand-alone-fmu
2) S-Function Builder block: This allows you to integrate existing C/C++ code into Simulink. The S-Function Builder block creates a S-Function wrapper for your external code, enabling you to generate a FMU from it. Refer here for more info:
If your S-Function is on MATLAB path but MATLAB doesn't seem to find it, refer to this for a possible resolution: https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by