It turned out that the tool I was integrating, which was developed by someone else in Matlab and converted into C++ with the coder, included a "rtwtypes.h" file. Because the tool was developed in a newer version of Matlab (2016 vs 2013), it was the root of a lot of redefinition errors and unrecognized types. After replacing it with the 2013 version of "rtwtypes.h" and adding in defines for "TRUE" and "FALSE", everything finallaly compiled together and worked. Last problem is that the PWork vector seems to lose its functionality if external libraries are used during compilation, and stranger still, external library static variables only persist for a single major time step in Simulink, so there's no easy workarounds.
Compile Model Reference with S-function & TLC
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Thomas Satterly Satterly
el 24 de Abr. de 2019
Respondida: Thomas Satterly Satterly
el 25 de Abr. de 2019
I have a working S-function that I can mex for use in normal mode and a TLC file that successfully compiles and runs in accelerator mode. However, when trying to use the S-function in an accelerated reference model or a standalone model in rapid accelerator mode, compilation fails. The errors started with redefinition errors, mainly in "matrix.h" vs. "rt_matrix". If I force the use of strictly matrix.h, the compiler seems to not know of the "bool" type in the files "slMdlrefSfcnBridge.h" and "matrix.h", as it complains about syntax errors (like "missing ')' before identifier"). Has anyone encounter these errors before, and is there a workaround?
0 comentarios
Respuesta aceptada
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!