Where can I find more documentation on the OptimizeModelRefInitCode option in Real-Time Workshop?

1 view (last 30 days)
I read the documentation regarding the OptimizeModelRefInitCode option, however, I am confused about when this option should be on and what it does. The current documentation provides the following description of this option:
Suppress generation of initialization code to accommodate the case where this model is referred to by a subsystem that resets its states when enabled. Select this option if the model will never be referred to by such a subsystem. Simulink reports an error if this constraint is violated, in which case you can disable this optimization.
From this page it is unclear what behavior is relative to the default state and which behavior is relative to the on state.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
Documentation on the OptimizeModelRefInitCode option is missing from Real-Time Workshop. Here is additional information on the OptimizeModelRefInitCode option:
When the OptimizeModelRefInitCode option is on, Real-Time Workshop generates run-time initialization code for a block that has states only if the block is in a system that can reset its states, such as an enabled subsystem. This results in more efficient code, but requires that you not refer to the model from a Model block that resides in a system that resets its states. Such nesting results in an error. Turn this option off only if your application requires you refer to the model from Model blocks in systems that can reset their states.
A description of this option can also be found in the Real-Time Workshop Embedded Coder documentation under "Code Generation Options and Optimizations > A Guide to the ERT Target Options > Optimization Pane > Data Initialization Subpane > Optimize initialization code for model reference".

More Answers (0)

Categories

Find more on Manual Performance Optimization in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!