Borrar filtros
Borrar filtros

slbuild Simulink model subsystem failure

12 visualizaciones (últimos 30 días)
Vico Wu
Vico Wu el 18 de En. de 2023
Respondida: Ganapathi Subramanian el 3 de Mzo. de 2023
I have a simulink model, there is subsystem inside the model, and I want to generate C code from the subsystem in the model using the slbuild function. However, it prompts that only models or model handles can be generated.The help documentation describes the code generation that can be used for subsystem. How can I generate it? I'm using a script generation.
SubSysName = [strSubSysName '/' strBlkName];
slbuild(SubSysName);
Warning: rtwbuild failed to generate code for LmpCtrl,First argument to 'slbuild' must be a model name or a handle to a model.

Respuestas (1)

Ganapathi Subramanian
Ganapathi Subramanian el 3 de Mzo. de 2023
It is my understanding that you are working on a Simulink model and has an uncertainty in generating C code for a subsystem.
To generate C code for a subsystem, 'slbuild' function is used. The syntax for slbuild function for a subsystem is ‘slbuild(SubSysName)’. Here the ‘SubSysName’ corresponds to the full block path of the subsystem.
SubSysName=[strModelName '/' strSubSysName];
%strModelName is the name of the model which has the subsytem
slbuild(SubSysName);

Categorías

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

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by