How to get correct embedded code generation of Lookup Table?
Show older comments
Hello,
I am trying to get Simulink to generate c-code for a lookup table block via embedded coder. I would like to generate code for only this small section to then schedule within my larger project.
When I go through the process to generate code there are no errors found, however the code generated only controls timing, it does not handle any inputs or outputs.
My question now becomes, what is the minimum necessary components in Simulink to generate code for a lookup table? (Current generated step function is included below)
/* Model step function */
void SOC_Loss_LUT_step(void)
{
/* Update absolute time for base rate */
/* The "clockTick0" counts the number of times the code of this task has
* been executed. The absolute time is the multiplication of "clockTick0"
* and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
* overflow during the application lifespan selected.
*/
rtM->Timing.t[0] =
((time_T)(++rtM->Timing.clockTick0)) * rtM->Timing.stepSize0;
{
/* Update absolute timer for sample time: [0.2s, 0.0s] */
/* The "clockTick1" counts the number of times the code of this task has
* been executed. The resolution of this integer timer is 0.2, which is the step size
* of the task. Size of "clockTick1" ensures timer will not overflow during the
* application lifespan selected.
*/
rtM->Timing.clockTick1++;
}
}
Accepted Answer
More Answers (0)
Categories
Find more on Test Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!