After C Code Generation Using Simulink/Embedded Coder, How to Use it in My C/C++ Project?
Mostrar comentarios más antiguos
If the result of C Code Generation fom Simulink/Embedded Coder contains such below function,
extern void Model_initialize(RT_MODEL_T *const Model_M)
{
....
}
extern void Model_step(RT_MODEL_T *const Model_M, real_T Model_U_arg1[3], real_T Model_U_arg2[6], real_T Model_U_arg3[9], real_T Model_Y_arg4[3])
{
....
}
extern void Model_terminate(RT_MODEL_T *const Model_M)
{
....
}
How to implement that code in my C/C++ Project?
I can do that with Matlab Coder and Matlab Function, but not with Simulink/Embedded Coder and Simulink Block Diagram.
I mean if I can make a Matlab Function, which works the same as the Simulink block diagram does, Matlab coder would give me such below function
extern void someFunction(const double arg1[3], const double arg2[6], const double arg3[9], const double arg4[3])
{
....
}
So I can just use that function, as including header and calling that function.
However, The reulst of Simulink/Embedded Coder seems to have different sturcture or mechanism with that of Matlab Coder. In my CMake Project, I got this error when call generated function
undefined reference to `Model_M_initialize(tag_RTM_Model_M_T*)'
undefined reference to 'Model_M_step(tag_RTM_Model_M_T*, double*, double*, double*, double*)'
Again, what to do to implement the C Code Function, Simulink/Embedded Coder gave me?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Simulink Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
