How to make non inlined s-functions inlined for code generation

10 visualizaciones (últimos 30 días)
Aubrey
Aubrey el 5 de Ag. de 2024
Respondida: Raghava S N el 7 de Ag. de 2024
I'm in simulink with a subsystem, I right click, c c++ code gen, create s-function. When I control b to build code, I get an error about non-inlined sfunction. I see I need the sfunction.tlc header file to create an inlined sfunction. How do I create this for each s-function I need to build for?
sfcn' is a non-inlined S-function, which is not supported with the current configuration. Consider selecting Support non-inlined S-functions.

Respuestas (1)

Raghava S N
Raghava S N el 7 de Ag. de 2024
Hi Aubrey,
Writing S-functions to be included in generated code involves requirements that go beyond writing S-functions used only for simulation. Before proceeding to inline an S-function, make sure that it meets the requirements for code generation and functions as expected. For more information, refer to the documentation of “S-Functions and Code Generation” by using the “web” command in the MATLAB command window -
web(fullfile(docroot, '/rtw/ug/s-functions-and-code-generation.html'))
Once the requirements are met, you can inline the functionality of MATLAB file S-functions in the generated code. For the step-by-step guide on how to inline MATLAB File S-Functions in Simulink, refer to the documentation of “Inline S-Functions” by using the “web” command in the MATLAB command window -
web(fullfile(docroot, '/rtw/tlc/introduction-inline-s-functions.html'))
Hope this helps!
Raghava

Categorías

Más información sobre Function Creation en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by