RT-Lab Simulink Model Warning Messages Warning: The Signal

advertisement
RT-Lab Simulink Model Warning Messages
Warning: The Signal Storage Reuse parameter is set to on. To see all signals of the model, this
option must be set to off. To modify this parameter, open the 'Simulation/Configuration
Parameters/Optimization' dialog box and modify the Signal Storage Reuse parameter.
Reusing memory buffers in RT-Lab model means that you may not be able to see all the signals
in the model when it is running in real-time.
Warning: Block Reduction Optimization is set to ON. Real Time Workshop will optimize and
remove some unused blocks in the model. Those signals might not be visible with Rt-Lab
Dynamic Acquisition after compilation. This option can be changed in the Simulink model :
Simulation/Configuration Parameters/Optimization
Block reduction removes accumulators, Redundant type conversions, dead code, and Fast-toslow Rate Tranistion blocks (single-tasking). These signal may not be visible with Dynamic Data
acquisition when running with RT-lab in real-time.
Warning: The inline parameters option is set to on and RT-LAB doesn't support this setting. Open
the 'Simulation/Configuration Parameters/Optimization' dialog box and modify the inline
parameters option. RT-LAB will set this option to off automatically during compilation.
This setting is not supported by RT-Lab because of the method of parameter control used by RTlab. The default in Simulink is to set the Inline parameters option to off.
1
2/12/2016
Signal storage reuse
Reuse signal memory.
Settings
Default: On
On
Simulink software reuses memory buffers allocated to store block input and
output signals, reducing the memory requirement of your real-time program.
Off
Simulink software allocates a separate memory buffer for each block's outputs.
This makes all block outputs global and unique, which in many cases significantly
increases RAM and ROM usage.
Tips




This option applies only to signals with storage class Auto.
Turning this option off can substantially increase the amount of memory required
to simulate large models.
Disable this option if you need to:
o Debug a C-MEX S-function
o Use a Floating Scope or a Display block with the Floating display option
selected to inspect signals in a model that you are debugging
Simulink software opens an error dialog if Signal storage reuse is enabled and
you attempt to use a Floating Scope or floating Display block to display a signal
whose buffer has been reused.
Dependencies
This parameter enables:



Enable local block outputs
Reuse block outputs
Eliminate superfluous temporary variables (Expression folding)
Command-Line Information
Parameter: OptimizeBlockIOStorage
2
2/12/2016
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application
Setting
Debugging
Off
Traceability
Off
Efficiency
On
Safety precaution No impact
Block reduction
Reduce execution time by collapsing or removing groups of blocks.
Settings
Default: On
On
Simulink® software searches for and reduces the following block patterns:




Accumulators — A group consisting of a Constant block, a Sum block,
and feedback through a Unit Delay block.
Redundant type conversions — Unnecessary type conversion blocks,
such as an int type conversion block with an input and output of type
int.
Dead code — Blocks or signals in an unused code path.
Fast-to-slow Rate Transition block in a single-tasking system — Rate
Transition blocks with an input frequency faster than its output frequency.
Off
Simulink software does not search for block patterns that can be optimized.
Simulation and generated code are not optimized.
Tips
3
2/12/2016





When you select Block reduction, Simulink software collapses certain groups of
blocks into a single, more efficient block, or removes them entirely. This results
in faster execution during model simulation and in generated code.
Block reduction does not change the appearance of the source model.
Tunable parameters do not prevent a block from being reduced by dead code
elimination.
Once block reduction takes place, Simulink software does not display the sorted
order for blocks that have been removed.
Block reduction is intended to remove only the generated code that represents
execution of a block. Other supporting data, such as definitions for sample time
and data types might remain in the generated code.
Accumulators. Simulink software recognizes the block diagram shown in the following
figure as an accumulator:


An accumulator construct is recognized anywhere across a block diagram, or
within subsystems at lower levels.
With the Block reduction option enabled, Simulink software creates a
synthesized block, Sum_synth_accum. The synthesized block replaces the
previous block diagram, resulting in a simple increment calculation.
Dead Code Elimination. Any blocks or signals in an unused code path are eliminated
from generated code.



The following conditions need to be met for a block to be considered part of an
unused code path:
o All signal paths for the block end with a block that does not execute.
Examples of blocks that do not execute include Terminator blocks,
disabled Assertion blocks, S-Function blocks configured for block
reduction, and To Workspace blocks for which MAT-file logging is
disabled for code generation.
o No signal paths for the block include global signal storage downstream
from the block.
Tunable parameters do not prevent a block from being reduced by dead code
elimination.
Consider the signal paths in the following block diagram.
4
2/12/2016
If you check Block reduction, Real-Time Workshop software responds to each
signal path as follows:
For Signal
Path...
Real-Time Workshop Software...
In1 to Out1
Always generates code because dead code elimination
conditions are not met.
In2 to
Terminator
Never generates code because dead code elimination conditions
are met.
In3 to Scope
Generates code if MAT-file logging is enabled and eliminates
code if MAT-file logging is disabled.
Command-Line Information
Parameter: BlockReduction
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application
Setting
Debugging
Off (for simulation and during development)
No impact (for production code generation)
Traceability
Off
Efficiency
On
Safety precaution Off
5
2/12/2016
Inline parameters
Transform tunable parameters into constant values.
Settings
Default: Off
On
Enabling Inline parameters has the following effects:



Real-Time Workshop software uses the numerical values of model
parameters, instead of their symbolic names, in generated code.
Reduces global RAM usage, because parameters are not declared in the
global parameters structure.
The Configure button becomes enabled. Clicking the Configure button
opens the Model Parameter Configuration dialog box.
Off
Uses symbolic names for model parameters in generated code.
Tips




Simulink software allows you to override the Inline parameters option for
parameters whose values are defined by variables in the MATLAB® workspace.
To specify that such a parameter remain tunable, specify the parameter as global
in the Model Configuration Parameters dialog box (see Model Parameter
Configuration Dialog Box). To display the dialog box, click the adjacent
Configure button.
To tune a global parameter, change the value of the corresponding workspace
variable and select Update Diagram (Ctrl+D) from the Simulink Edit menu.
You cannot tune inlined parameters in code generated from a model. However,
when simulating a model, you can tune an inlined parameter if its value derives
from a workspace variable. For example, suppose that a model has a Gain block
whose Gain parameter is inlined and equals a, where a is a variable defined in the
model's workspace. When simulating the model, Simulink software disables the
Gain parameter field, preventing you from using the block's dialog box to change
the gain. However, you can still tune the gain by changing the value of a at the
MATLAB command line and updating the diagram.
When a top-level model uses referenced models:
o All referenced models must specify Inline parameters to be on.
o The top-level model can specify Inline parameters to be on or off.
6
2/12/2016
See Inline Parameter Requirements for more information.
Dependencies
This parameter enables:


Configure button
Inline invariant signals
Command-Line Information
Parameter: InlineParams
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application
Setting
Debugging
Off (for simulation and during development)
On (for production code generation)
Traceability
On
Efficiency
On
Safety precaution No impact
7
2/12/2016
Download