How do I create stub functions in simulink for legacy code?
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I would like to use sfunctions to create function calls to a external c functions. I don't want to build the actual legacy code when I try to build the model, but I would rather just create stub functions. What is the best way to accomplish this?
I have created stub.h./stub.c files with empty function calls (with the actual function call names), and then generated the sfunctions with the legacy code tool, but of course the autocoder includes stub.h. Rather than stub.h, I would rather include the actual .h file that is the true header file.
Thank you for and advice.
0 comentarios
Respuestas (1)
Kaustubha Govind
el 16 de Ag. de 2013
I think the right way to do what you want to achieve is to create a DLL for your external C-functions and load it dynamically from the S-function. Note that the interface to the functions still needs to be fully specified in the header file and if changed needs the S-function to be re-compiled. However, using a DLL allows you to compile/maintain your external C code independently from the S-function.
0 comentarios
Ver también
Categorías
Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!