
Code Generation Error with S-Function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Serhat Sarihan
el 5 de Dic. de 2024
Comentada: Serhat Sarihan
el 6 de Dic. de 2024
I have a simple model

with a simple S-function project that does multiplication.

When I try to generate code from this model with the following build command
clear, clc
rtwbuild('Test_Model')
I get loads of errors as follows;

Somehow, I think, it has to do with custom code part of model configuration which I could not fix.

Without changing the S-Function project, I would like to be able to generate code successfully.
0 comentarios
Respuesta aceptada
Githin George
el 6 de Dic. de 2024
Editada: Githin George
el 6 de Dic. de 2024
Hi Serhat,
You might have missed adding your dependencies (multiplier.cpp) to your S-Function in the block parameters. This usually helps Simulink figure out all the CPP files required to do the code generation and avoid any potential linker errors. In my case "multiply_sfunction" is my S-Function and it depends on the CPP file "multiply.cpp"
See the Image below:

From the images I am assuming you are using CPP files instead of tlc to define your S-Function in which case this should work fine.
Refer to the documentation below:
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!