Understanding which storage class is used

2 views (last 30 days)
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?

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!