Understanding which storage class is used

4 visualizaciones (últimos 30 días)
bert de Jong
bert de Jong el 31 de Mzo. de 2020
I am trying to understand the bevaviour of the storage class assignment in Matlab.
Take the following example:
1. In the first scenario the storage class of 'lineSignal' is set to 'GetSet' and 'outputSignal' is set to 'auto'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* ConstCode for Constant: '<Root>/Constant' */
set_lineSignal(1.0);
}
2. In the second scenario the storage class of 'lineSignal' is set to 'auto' and 'outputSignal' is set to 'GetSet'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* (no initialization code required) */
}
3. In the third scenario the storage class of 'lineSignal' and 'outputSignal' are both set to 'GetSet'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* ConstCode for Constant: '<Root>/Constant' */
set_lineSignal(1.0);
}
Based on this, I have two questions:
  1. Why is the initialization code not generated when the GetSet storage class is used on a port?
  2. Which storage class for which signal is used for code generation?

Respuestas (0)

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by