How to configure embeded coder, so that global parameters will not be initialized where they are defined but in the init function?

1 visualización (últimos 30 días)
Hallo,
when I generate code and I have e.g. a parameter defined in the data dictionary with storage class = "Auto", the code generator will generate something like this:
/* Model block global parameters (auto storage) */
UInt16 rtP_myParameter123_u16 = 1U; /* Variable: myParameter123_u16
But in our project it's not allowed to init variables here but only in the init function (due to Soft-Reset functionality) Therefore I need the code like:
/* Model block global parameters (auto storage) */
UInt16 rtP_myParameter123_u16; /* Variable: myParameter123_u16
And in the init function:
/* Model initialize function */
void myModel_initialize(void)
{
rtP_myParameter123_u16 = 1U;
...
I also need this behaviour not only for parameters but in general for all inits.
Thank you

Respuestas (0)

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by