Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

What's the correct scheduling of calling C functions of a Simulink model after Simulink Coder conversion?

1 visualización (últimos 30 días)
I've used Simulink to build a subsystem and converted it into C using Simulink Coder. Then I will write my main function where the subsystem's C functions (mdlOutput(), mdlUpdate(), etc) will be called, as follows:
/* scheduling 1*/
main()
{
...
for (i=0;i<100;i++)
{
mdlOutput();
mdl_U = 1-mdl_Y; /* updating input using output */
mdlUpdate();
}
...
}
You can see that a feedback is formed in the main function. However, I've seen many examples where mdl_U is put ahead of mdlOuput(), like:
/* scheduling 2*/
main()
{
...
for (i=0;i<100;i++)
{
mdl_U = 1-mdl_Y; /* updating input using output */
mdlOutput();
mdlUpdate();
}
...
}
Above two schedulings give different results. I'm wondering which one is correct? Many thanks for any help.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by