Hi,
Answering your questions.
1) No, this is not a standard or supported workflow.
- FMU (Functional Mock-up Unit) blocks in Simulink are meant for simulation within Simulink, not for direct code generation and deployment as .slx models to external (Linux) targets.
- The generated code from a Simulink model that includes FMU blocks depends on MathWorks-internal support files (like rtwcg_fmu2_target.h), which are not open-source or distributed for external compilation.
Following are a few workarounds for the same
1. Simulation-only:
If you need to use FMUs, run the simulation inside Simulink. Code generation and deployment to external targets is not supported for FMU blocks.
2. For code generation/deployment:
- Remove FMU blocks from your model before generating code for deployment.
- If you need the FMU logic on your Linux target, consider:
- Running the FMU directly on Linux using an FMU runtime/library (e.g., FMPy, PyFMI, or C FMI APIs).
- Wrap the FMU as a C/C++ library and interface with your application, bypassing Simulink code generation.