Simulink 7 - GUI
Simulink 7 - GUI
www.mathworks.com Web
comp.soft-sys.matlab Newsgroup
www.mathworks.com/contact_TS.html Technical Support
508-647-7000 (Phone)
508-647-7001 (Fax)
Configuration Parameters
Dialog Box
Note You can also use the Model Explorer to modify settings for the active
configuration set or any other configuration set. See The Model Explorer
for more information.
1-2
Configuration Parameters Dialog Box Overview
The dialog box groups the configuration parameters into various categories.
To display the parameters for a specific category, click the category in the
Select tree on the left side of the dialog box.
In most cases, Simulink® software does not apply changes until you click OK
or Apply at the bottom of the dialog box. The OK button applies your changes
and dismisses the dialog box. The Apply button applies your changes but
leaves the dialog box open.
1-3
1 Configuration Parameters Dialog Box
1-4
Model Configuration Pane
In the Model Explorer you can edit the name and description of your
configuration sets.
When editing the Model Configuration preferences, you can click Restore
to Default Preferences to restore the default configuration settings for
creating new models. These underlying defaults cannot be changed.
1-5
1 Configuration Parameters Dialog Box
Name
Specify the name of your configuration set.
Settings
Default: Configuration (for Active configuration set) or Configuration
Preferences (for default configuration set).
1-6
Model Configuration Pane
Description
Specify a description of your configuration set.
Settings
No Default
1-7
1 Configuration Parameters Dialog Box
Solver Pane
In this section...
“Solver Overview” on page 1-10
“Start time” on page 1-12
“Stop time” on page 1-14
“Type” on page 1-16
“Solver” on page 1-19
“Max Step Size” on page 1-27
“Initial Step Size” on page 1-29
“Min Step Size” on page 1-31
“Relative tolerance” on page 1-33
“Absolute tolerance” on page 1-35
“Maximum order” on page 1-38
“Solver reset method” on page 1-40
1-8
Solver Pane
In this section...
“Number of consecutive min steps” on page 1-42
“Shape preservation” on page 1-44
“Tasking mode for periodic sample times” on page 1-46
“Automatically handle rate transition for data transfer” on page 1-48
“Deterministic data transfer” on page 1-50
“Higher priority value indicates higher task priority” on page 1-52
“Zero-crossing control” on page 1-54
“Time tolerance” on page 1-56
“Number of consecutive zero crossings” on page 1-58
“Algorithm” on page 1-60
“Signal threshold” on page 1-62
“Periodic sample time constraint” on page 1-64
“Fixed-step size (fundamental sample time)” on page 1-67
“Sample time properties” on page 1-69
“Extrapolation order” on page 1-72
“Number Newton’s iterations” on page 1-74
1-9
1 Configuration Parameters Dialog Box
Solver Overview
Specify the simulation start and stop time, and the solver configuration for
the simulation. Use the Solver pane to set up a solver for a model’s active
configuration set.
Configuration
3 Set the parameters displayed for the selected type and solver combination.
Tips
• Simulation time is not the same as clock time. For example, running
a simulation for 10 seconds usually does not take 10 seconds. Total
simulation time depends on factors such as model complexity, solver step
sizes, and computer speed.
• Fixed-step solver type is required for code generation, unless you use an
S-function or RSim target.
• Variable-step solver type can significantly shorten the time required
to simulate models in which states change rapidly or which contain
discontinuities.
See Also
• Solvers
• Choosing a Solver
• Specifying a Simulation Start and Stop Time
1-10
Solver Pane
1-11
1 Configuration Parameters Dialog Box
Start time
Specify the start time for the simulation or generated code as a
double-precision value, scaled to seconds.
Settings
Default: 0.0
• A start time other than 0.0 is an offset, and must be less than or equal to
the stop time. An example of when you might use an offset is to set up a
delay to accommodate some type of initialization.
• The values of block parameters with initial conditions must match the
initial condition settings at the specified start time.
• Simulation time is not the same as clock time. For example, running
a simulation for 10 seconds usually does not take 10 seconds. Total
simulation time depends on factors such as model complexity, solver step
sizes, and computer speed.
Command-Line Information
Parameter: StartTime
Type: string
Value: any valid value
Default: '0.0'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution 0.0
1-12
Solver Pane
See Also
1-13
1 Configuration Parameters Dialog Box
Stop time
Specify the stop time for the simulation or generated code as a double-precision
value, scaled to seconds.
Settings
Default: 10
Command-Line Information
Parameter: StopTime
Type: string
Value: any valid value
Default: '10.0'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Any positive value
1-14
Solver Pane
See Also
1-15
1 Configuration Parameters Dialog Box
Type
Select the type of solver you want to use to simulate your model.
Settings
Default: Variable-step
Variable-step
Step size varies from step to step, depending on model dynamics. A
variable-step solver:
• Reduces step size when model states change rapidly, to maintain
accuracy.
• Increases step size when model states change slowly, to avoid
unnecessary steps.
Note The solver computes the next time as the sum of the current time and
the step size.
Dependencies
Selecting Variable-step enables the following parameters:
• Solver
• Max step size
• Min step size
1-16
Solver Pane
• Solver
• Periodic sample time constraint
• Fixed-step size (fundamental sample time)
• Tasking mode for periodic sample times
• Higher priority value indicates higher task priority
• Automatically handle rate transitions for data transfers
Command-Line Information
Parameter: SolverType
Type: string
Value: 'Variable-step' | 'Fixed-step'
Default: 'Variable-step'
Recommended Settings
Application Setting
Debugging No impact
1-17
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution Fixed-step
See Also
• Solvers
• Choosing a Solver
• “Purely Discrete Systems”
• Configuration Parameters Dialog Box
• Solver Pane
1-18
Solver Pane
Solver
Select the solver you want to use to compute the model’s states during
simulation or code generation.
Settings
The available solvers change depending on which solver Type you selected:
ode3 (Bogacki-Shampine)
Computes the model’s state at the next time step as an explicit function
of the current value of the state and the state derivatives, using the
Bogacki-Shampine Formula integration technique to compute the state
derivatives. In the following example, X is the state, DX is the state
derivative, and h is the step size:
Use this solver for models with no states or discrete states only, using a
fixed step size. Relies on the model’s blocks to update discrete states.
1-19
1 Configuration Parameters Dialog Box
ode5 (Dormand-Prince)
Computes the model’s state at the next time step as an explicit function
of the current value of the state and the state derivatives. Uses the
Dormand-Prince Formula integration technique to compute the state
derivatives. In the following example, X is the state, DX is the state
derivative, and h is the step size:
ode4 (Runge-Kutta)
Uses the Fourth-Order Runge-Kutta (RK4) Formula integration
technique to compute the model’s state at the next time step as
an explicit function of the current value of the state and the state
derivatives. In the following example, X is the state, DX is the state
derivative, and h is the step size:
ode2 (Heun)
Uses the Heun’s Method integration technique to compute the model’s
state at the next time step as an explicit function of the current value of
the state and the state derivatives. In the following example, X is the
state, DX is the state derivative, and h is the step size:
ode1 (Euler)
Uses the Euler’s Method integration technique to computes the model’s
state at the next time step as an explicit function of the current value of
the state and the state derivatives. In the following example, X is the
state, DX is the state derivative, and h is the step size:
ode14x (extrapolation)
Uses a combination of Newton’s method and extrapolation from the
current value to compute the model’s state at the next time step, as an
implicit function of the state and the state derivative at the next time
step. In the following example, X is the state, DX is the state derivative,
and h is the step size:
1-20
Solver Pane
This solver requires more computation per step than an explicit solver,
but is more accurate for a given step size.
ode45 (Dormand-Prince)
Computes the model’s state at the next time step using an explicit
Runge-Kutta (4,5) formula (the Dormand-Prince pair) for numerical
integration.
ode45 is a one-step solver, and therefore only needs the solution at the
preceding time point.
Use this solver for models with no states or discrete states only, using
a variable step size.
ode23 (Bogacki-Shampine)
Computes the model’s state at the next time step using an explicit
Runge-Kutta (2,3) formula (the Bogacki-Shampine pair) for numerical
integration.
ode23 is a one-step solver, and therefore only needs the solution at the
preceding time point.
1-21
1 Configuration Parameters Dialog Box
ode15s (stiff/NDF)
Computes the model’s state at the next time step using variable-order
numerical differentiation formulas (NDFs). These are related to, but
more efficient than the backward differentiation formulas (BDFs), also
known as Gear’s method.
ode15s is efficient for stiff problems. Try this solver if ode45 fails or is
inefficient.
ode23s (stiff/Mod. Rosenbrock)
Computes the model’s state at the next time step using a modified
Rosenbrock formula of order 2.
ode23s is more efficient than ode15s at crude tolerances, and can solve
stiff problems for which ode15s is ineffective.
ode23t (Mod. stiff/Trapezoidal)
Computes the model’s state at the next time step using an
implementation of the trapezoidal rule with a “free” interpolant.
Use ode23t if the problem is only moderately stiff and you need a
solution with no numerical damping.
ode23tb (stiff/TR-BDF2)
Computes the model’s state at the next time step using a multistep
implementation of TR-BDF2, an implicit Runge-Kutta formula with a
trapezoidal rule first stage, and a second stage consisting of a backward
differentiation formula of order two. By construction, the same iteration
matrix is used in evaluating both stages.
ode23tb is more efficient than ode15s at crude tolerances, and can solve
stiff problems for which ode15s is ineffective.
1-22
Solver Pane
Tips
Dependencies
Selecting the ode1 (Euler) , ode2 (Huen), ode 3 (Bogacki-Shampine),
ode4 (Runge-Kutta), ode 5 (Dormand-Prince), or Discrete (no
continuous states) fixed-step solvers enables the following parameters:
1-23
1 Configuration Parameters Dialog Box
1-24
Solver Pane
Command-Line Information
Parameter: Solver
Type: string
Value: 'VariableStepDiscrete' | 'ode45' | 'ode23' |
'ode113' | 'ode15s' | 'ode23s' | 'ode23t' | 'ode23tb' |
'FixedStepDiscrete' | 'ode5' | 'ode4' | 'ode3' | 'ode2' |
'ode1' | 'ode14x'
Default: 'ode45'
1-25
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Discrete (no continuous states)
See Also
• Solvers
• Choosing a Solver
• “Purely Discrete Systems”
• Configuration Parameters Dialog Box
• Solver Pane
1-26
Solver Pane
Settings
Default: auto
• For the discrete solver, the default value (auto) is the model’s shortest
sample time.
• For continuous solvers, the default value (auto) is determined from
the start and stop times. If the stop time equals the start time or is
inf, Simulink software chooses 0.2 seconds as the maximum step size.
Otherwise, it sets the maximum step size to
Tips
• Generally, the default maximum step size is sufficient. If you are concerned
about the solver missing significant behavior, change the parameter to
prevent the solver from taking too large a step.
• If the time span of the simulation is very long, the default step size might
be too large for the solver to find the solution.
• If your model contains periodic or nearly periodic behavior and you know
the period, set the maximum step size to some fraction (such as 1/4) of
that period.
• In general, for more output points, change the refine factor, not the
maximum step size. For more information, see Specifying Output Options.
Dependencies
This parameter is enabled only if the solver Type is set to Variable-step.
1-27
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: MaxStep
Type: string
Value: any valid value
Default: 'auto'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-28
Solver Pane
Settings
Default: auto
By default, the solver selects an initial step size by examining the derivatives
of the states at the start time.
Tips
• Be careful when increasing the initial step size. If the first step size is too
large, the solver might step over important behavior.
• The initial step size parameter is a suggested first step size. The solver
tries this step size but reduces it if error criteria are not satisfied.
Dependencies
This parameter is enabled only if the solver Type is set to Variable-step.
Command-Line Information
Parameter: InitialStep
Type: string
Value: any valid value
Default: 'auto'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-29
1 Configuration Parameters Dialog Box
See Also
• “Purely Discrete Systems”
• Improving Simulation Performance and Accuracy
• Configuration Parameters Dialog Box
• Solver Pane
1-30
Solver Pane
Settings
Default: auto
Tips
Dependencies
This parameter is enabled only if the solver Type is set to Variable-step.
Command-Line Information
Parameter: MinStep
Type: string
Value: any valid value
Default: 'auto'
1-31
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-32
Solver Pane
Relative tolerance
Specify the largest acceptable solver error, relative to the size of each state
during each time step. If the relative error exceeds this tolerance, the solver
reduces the time step size.
Settings
Default: 1e-3
Tips
• The acceptable error at each time step is a function of both the Relative
tolerance and the Absolute tolerance. For more information about how
these settings work together, see Specifying Variable-Step Solver Error
Tolerances.
• During each time step, the solver computes the state values at the end of
the step and also determines the local error – the estimated error of these
state values. If the error is greater than the acceptable error for any state,
the solver reduces the step size and tries again.
• The default relative tolerance value is sufficient for most applications.
Decreasing the relative tolerance value can slow down the simulation.
• To check the accuracy of a simulation after you run it, you can reduce
the relative tolerance to 1e-4 and run it again. If the results of the two
simulations are not significantly different, you can feel confident that the
solution has converged.
Dependencies
This parameter is enabled only if you set:
1-33
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: RelTol
Type: string
Value: any valid value
Default: '1e-3'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-34
Solver Pane
Absolute tolerance
Specify the largest acceptable solver error, as the value of the measured
state approaches zero. If the absolute error exceeds this tolerance, the solver
reduces the time step size.
Settings
Default: auto
• The default value (auto) initially sets the absolute tolerance for each state
to 1e-6. As the simulation progresses, the absolute tolerance for each state
is reset to the maximum value that the state has thus far assumed times
the relative tolerance for that state.
For example, if a state goes from 0 to 1 and the Relative tolerance is 1e-3,
then by the end of the simulation the Absolute tolerance is set to 1e-3.
• If the computed setting is not suitable, you can determine an appropriate
setting yourself.
Tips
• The acceptable error at each time step is a function of both the Relative
tolerance and the Absolute tolerance. For more information about how
these settings work together, see Specifying Variable-Step Solver Error
Tolerances.
• The Integrator, Transfer Fcn, State-Space, and Zero-Pole blocks allow you
to specify absolute tolerance values for solving the model states that they
compute or that determine their output. The absolute tolerance values that
you specify in these blocks override the global setting in the Configuration
Parameters dialog box.
• You might want to override the Absolute tolerance setting using blocks if
the global setting does not provide sufficient error control for all of your
model’s states, for example if they vary widely in magnitude.
• If you set the Absolute tolerance too low, the solver may take too many
steps around near-zero state values, slowing down the simulation.
• To check the accuracy of a simulation after you run it, you can reduce the
absolute tolerance and run it again. If the results of the two simulations
1-35
1 Configuration Parameters Dialog Box
are not significantly different, you can feel confident that the solution
has converged.
• If your simulation results do not seem accurate, and your model has states
whose values approach zero, the Absolute tolerance may be too large.
Reduce the Absolute tolerance to force the simulation to take more steps
around areas of near-zero state values.
Dependencies
This parameter is enabled only if you set:
Command-Line Information
Parameter: AbsTol
Type: string
Value: any valid value
Default: 'auto'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-36
Solver Pane
See Also
1-37
1 Configuration Parameters Dialog Box
Maximum order
Settings
Default: 5
5
Specifies that the solver uses fifth order NDFs.
1
Specifies that the solver uses first order NDFs.
2
Specifies that the solver uses second order NDFs.
3
Specifies that the solver uses third order NDFs.
4
Specifies that the solver uses fourth order NDFs.
Tips
• Although the higher order formulas are more accurate, they are less stable.
• If your model is stiff and requires more stability, reduce the maximum
order to 2 (the highest order for which the NDF formula is A-stable).
• As an alternative, you can try using the ode23s solver, which is a lower
order (and A-stable) solver.
Dependencies
This parameter is enabled only if Solver is set to ode15s.
1-38
Solver Pane
Command-Line Information
Parameter: MaxOrder
Type: integer
Value: 1 | 2 | 3 | 4 | 5
Default: 5
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-39
1 Configuration Parameters Dialog Box
Settings
Default: Fast
Fast
Specifies that the solver will not recompute the Jacobian matrix at a
solver reset.
Robust
Specifies that the solver will recompute the Jacobian matrix needed by
the integration step at every solver reset.
Tips
Dependencies
This parameter is enabled only if you select one of the following solvers:
• ode15s (Stiff/NDF)
• ode23t (Mod. Stiff/Trapezoidal)
• ode23tb (Stiff/TR-BDF2)
Command-Line Information
Parameter: SolverResetMethod
Type: string
Value: 'Fast' | 'Robust'
Default: 'Fast'
1-40
Solver Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Choosing a Solver
• Configuration Parameters Dialog Box
• Solver Pane
1-41
1 Configuration Parameters Dialog Box
Settings
Default: 1
Dependencies
This parameter is enabled only if you set:
Command-Line Information
Parameter: MaxConsecutiveMinStep
Type: string
Value: any valid value
Default: '1'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-42
Solver Pane
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
• Choosing a Solver
• Min step size violation
• Min step size
• Configuration Parameters Dialog Box
• Solver Pane
1-43
1 Configuration Parameters Dialog Box
Shape preservation
At each time step use derivative information to improve integration accuracy.
Settings
Default: Disable all
Disable all
Do not perform Shape preservation on any signals
Enable all
Perform Shape preservation on all signals.
Tips
• The default setting (Disable all) usually provides good accuracy for most
models.
• Setting to Enable all will increase accuracy in those models having
signals whose derivative exhibits a high rate of change, but simulation
time may be increased.
Dependencies
This parameter is enabled only if a continuous-step solver is used.
Command-Line Information
Parameter: ShapePreserveControl
Type: string
Value: 'EnableAll' | 'DisableAll'
Default: 'DisableAll'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-44
Solver Pane
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
• Zero-Crossing Detection
• Solver Pane
1-45
1 Configuration Parameters Dialog Box
Settings
Default: Auto
Auto
Specifies that single-tasking execution is used if:
• Your model contains one sample time.
• Your model contains a continuous and a discrete sample time, and
the fixed-step size is equal to the discrete sample time.
Tip
The Multitask rate transition parameter on the Diagnostics > Sample
Time pane allows you to adjust error checking for sample rate transitions
between blocks that operate at different sample rates.
Dependency
This parameter is enabled by selecting Fixed-step solver type.
1-46
Solver Pane
Command-Line Information
Parameter: SolverMode
Type: string
Value: 'Auto' | 'SingleTasking' | 'MultiTasking'
Default: 'Auto'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-47
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Inserts hidden Rate Transition blocks between blocks when rate
transitions are detected. Handles rate transitions for asynchronous and
periodic tasks. Simulink software adds the hidden blocks configured
to ensure data integrity for data transfers. Selecting this option also
enables the parameter Deterministic data transfer, which allows you
to control the level of data transfer determinism for periodic tasks.
Off
Does not insert hidden Rate Transition blocks when rate transitions are
detected. If Simulink software detects invalid transitions, you must
adjust the model such that the sample rates for the blocks in question
match or manually add a Rate Transition block.
Tips
1-48
Solver Pane
Command-Line Information
Parameter: AutoInsertRateTranBlk
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact (for simulation and during
development)
Off (for production code generation)
Efficiency No impact
Safety precaution Off
See Also
1-49
1 Configuration Parameters Dialog Box
Always
Specifies that the block parameter Ensure deterministic data
transfer (maximum delay) is always set for auto-inserted Rate
Transition blocks.
1-50
Solver Pane
Dependencies
This parameter is enabled only if Automatically handle rate transition
for data transfer is checked.
Command-Line Information
Parameter: InsertRTBMode
Type: string
Value: 'Always' | 'Whenever possible'| 'Never (minimum delay)'
Default: 'Whenever possible'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution 'Whenever possible'
See Also
1-51
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Real-time system assigns higher priority values to higher priority tasks,
for example, 8 has a higher task priority than 4. Rate Transition blocks
treat asynchronous transitions between rates with lower priority values
and rates with higher priority values as low-to-high rate transitions.
Off
Real-time system assigns lower priority values to higher priority tasks,
for example, 4 has a higher task priority than 8. Rate Transition blocks
treat asynchronous transitions between rates with lower priority values
and rates with higher priority values as high-to-low rate transitions.
Command-Line Information
Parameter: PositivePriorityOrder
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-52
Solver Pane
See Also
1-53
1 Configuration Parameters Dialog Box
Zero-crossing control
Enables zero-crossing detection during variable-step simulation of the model.
For most models, this speeds up simulation by enabling the solver to take
larger time steps.
Settings
Default: Use local settings
Tips
Dependencies
This parameter is enabled only if the solver Type is set to Variable-step.
Selecting either Use local settings or Enable all enables the following
parameters:
1-54
Solver Pane
• Time tolerance
• Number of consecutive zero crossings
• Algorithm
Command-Line Information
Parameter: ZeroCrossControl
Type: string
Value: 'UseLocalSettings' | 'EnableAll' | 'DisableAll'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Zero-Crossing Detection
• Number of consecutive zero crossings
• Consecutive zero-crossings violation
• Time tolerance
• Configuration Parameters Dialog Box
• Solver Pane
1-55
1 Configuration Parameters Dialog Box
Time tolerance
Specify a tolerance factor that controls how closely zero-crossing events must
occur to be considered consecutive.
Settings
Default: 10*128*eps
dt < RelTolZC * t2
where dt is the time between zero crossings and RelTolZC is the Time
tolerance.
• Simulink software counts the number of consecutive zero crossings that it
detects. If the count exceeds the value of Number of consecutive zero
crossings allowed, Simulink software displays either a warning or error
as specified by the Consecutive zero-crossings violation diagnostic (see
Consecutive zero-crossings violation).
Tips
1-56
Solver Pane
• If your model experiences excessive zero crossings, you can also increase
the Number of consecutive zero crossings to increase the threshold
at which Simulink software triggers the Consecutive zero-crossings
violation diagnostic.
Dependencies
This parameter is enabled only if Zero-crossing control is set to either
Use local settings or Enable all.
Command-Line Information
Parameter: ConsecutiveZCsStepRelTol
Type: string
Value: any valid value
Default: '10*128*eps'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Zero-crossing Detection
• Zero-crossing Control
• Number of consecutive zero crossings
• Consecutive zero-crossings violation
• Configuration Parameters Dialog Box
• Solver Pane
1-57
1 Configuration Parameters Dialog Box
Settings
Default: 1000
Tips
• If your model experiences excessive zero crossings, you can increase this
parameter to increase the threshold at which Simulink software triggers
the Consecutive zero-crossings violation diagnostic. This may afford
your model’s behavior more time to recover.
• Simulink software resets the counter each time it detects nonconsecutive
zero crossings; therefore, decreasing the relative tolerance value may also
afford your model’s behavior more time to recover.
Dependencies
This parameter is enabled only if Zero-crossing control is set to either
Use local settings or Enable all.
Command-Line Information
Parameter: MaxConsecutiveZCs
Type: string
Value: any valid value
Default: '1000'
1-58
Solver Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Zero-Crossing Detection
• Zero-Crossing Control
• Consecutive zero-crossings violation
• Time tolerance
• Configuration Parameters Dialog Box
• Solver Pane
1-59
1 Configuration Parameters Dialog Box
Algorithm
Specifies the algorithm to detect zero crossings when a variable-step solver
is used.
Settings
Default: Nonadaptive
Adaptive
Use an improved zero-crossing algorithm which dynamically activates
and deactivates zero-crossing bracketing. With this algorithm you can
set a zero-crossing tolerance. See “Signal threshold” on page 1-62 to
learn how to set the zero-crossing tolerance.
Nonadaptive
Use the nonadaptive zero-crossing algorithm present in the Simulink
software prior to Version 7.0 (R2008a). This option is provided for
backward compatibility.
Tips
Dependencies
Command-Line Information
Parameter: ZeroCrossAlgorithm
Type: string
Value: 'Nonadaptive' | 'Adaptive'
Default: 'Nonadaptive'
1-60
Solver Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Zero-Crossing Detection
• Number of consecutive zero crossings
• Consecutive zero-crossings violation
• Time tolerance
• Configuration Parameters Dialog Box
• Solver Pane
1-61
1 Configuration Parameters Dialog Box
Signal threshold
Specifies the deadband region used during the detection of zero crossings.
Signals falling within this region are defined as having crossed through zero.
Settings
Default: Auto
Auto
The signal threshold is determined automatically by the adaptive
algorithm.
String
Use the specified value for the signal threshold. The value must be a
real number equal to or greater than zero.
Tips
• Entering too small of a value for the Signal Threshold parameter will
result in long simulation run times.
• Entering a large Signal Threshold value may improve the simulation
speed (especially in systems having extensive chattering). However,
making the value too large may reduce the simulation accuracy.
Dependency
This parameter is enabled if the zero-crossing Algorithm is set to Adaptive.
Command-Line Information
Parameter: ZCThreshold
Type: string
Value: 'auto' | any real number greater than or equal to zero
Default: 'auto'
1-62
Solver Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Zero-Crossing Detection
• Number of consecutive zero crossings
• Consecutive zero-crossings violation
• Time tolerance
• Configuration Parameters Dialog Box
• Solver Pane
1-63
1 Configuration Parameters Dialog Box
Settings
Default: Unconstrained
Unconstrained
Specifies no constraints. Selecting this option causes Simulink software
to display a field for entering the solver step size.
Simulink software checks to ensure that this model can inherit its
sample times from a model that references it without altering its
behavior. Models that specify a step size (i.e., a base sample time)
cannot satisfy this constraint. For this reason, selecting this option
causes Simulink software to hide the group’s step size field (see
Fixed-step size (fundamental sample time)).
Specified
Specifies that Simulink software check to ensure that this model
operates at a specified set of prioritized periodic sample times. Use
the Sample time properties option to specify and assign priorities to
model sample times.
1-64
Solver Pane
Tips
During simulation, Simulink software checks to ensure that the model
satisfies the constraints. If the model does not satisfy the specified constraint,
then Simulink software displays an error message.
Dependencies
This parameter is enabled only if the solver Type is set to Fixed-step.
Command-Line Information
Parameter: SampleTimeConstraint
Type: string
Value: 'unconstrained' | 'STIndependent' | 'Specified'
Default: 'unconstrained'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-65
1 Configuration Parameters Dialog Box
Application Setting
Efficiency No impact
Safety precaution Specified or Ensure sample time
independent
See Also
1-66
Solver Pane
Settings
Default: auto
• Entering auto (the default) in this field causes Simulink software to choose
the step size.
• If the model specifies one or more periodic sample times, Simulink software
chooses a step size equal to the least common denominator of the specified
sample times. This step size, known as the fundamental sample time of
the model, ensures that the solver will take a step at every sample time
defined by the model.
• If the model does not define any periodic sample times, Simulink software
chooses a step size that divides the total simulation time into 50 equal steps.
Dependencies
This parameter is enabled only if the Periodic sample time constraint is
set to Unconstrained.
Command-Line Information
Parameter: FixedStep
Type: string
Value: any valid value
Default: 'auto'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-67
1 Configuration Parameters Dialog Box
See Also
1-68
Solver Pane
Settings
No Default
• Enter an Nx3 matrix with rows that specify the model’s discrete sample
time properties in order from fastest rate to slowest rate.
• Faster sample times must have higher priorities.
Format.
See Specifying Sample Time for more details and options for specifying
sample time.
Example.
1-69
1 Configuration Parameters Dialog Box
Tips
• If the model’s fundamental rate differs from the fastest rate specified by
the model, specify the fundamental rate as the first entry in the matrix
followed by the specified rates, in order from fastest to slowest. See “Purely
Discrete Systems”.
• If the model operates at one rate, enter the rate as a three-element vector
in this field — for example, [0.1, 0, 10].
• When you update a model, Simulink software displays an error message if
what you specify does not match the sample times defined by the model.
• If Periodic sample time constraint is set to Unconstrained, Simulink
software assigns priority 40 to the model base sample rate. If Higher
priority value indicates higher task priority is selected, Simulink
software assigns priorities 39, 38, 37, and so on, to subrates of the base
rate. Otherwise, it assigns priorities 41, 42, 43, and so on, to the subrates.
• Continuous rate is assigned a higher priority than is the discrete base rate
regardless of whether Periodic sample time constraint is Specified or
Unconstrained.
Dependencies
This parameter is enabled by selecting Specified from the Periodic sample
time constraint list.
1-70
Solver Pane
Command-Line Information
Parameter: SampleTimeProperty
Type: structure
Value: any valid matrix
Default: []
• SampleTime
• Offset
• Priority
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Period, offset, and priority of each sample
time in the model; faster sample times
must have higher priority than slower
sample times
See Also
1-71
1 Configuration Parameters Dialog Box
Extrapolation order
Select the extrapolation order used by the ode14x solver to compute a model’s
states at the next time step from the states at the current time step.
Settings
Default: 4
1
Specifies first order extrapolation.
2
Specifies second order extrapolation.
3
Specifies third order extrapolation.
4
Specifies fourth order extrapolation.
Tip
Selecting a higher order produces a more accurate solution, but is more
computationally intensive per step size.
Dependencies
This parameter is enabled by selecting ode14x (extrapolation) from the
Solver list.
Command-Line Information
Parameter: ExtrapolationOrder
Type: integer
Value: 1 | 2 | 3 | 4
Default: 4
1-72
Solver Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-73
1 Configuration Parameters Dialog Box
Settings
Default: 1
Minimum: 1
Maximum: 2147483647
Dependencies
This parameter is enabled by selecting ode14x (extrapolation) from the
Solver list.
Command-Line Information
Parameter: NumberNewtonIterations
Type: integer
Value: any valid number
Default: 1
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-74
Solver Pane
See Also
1-75
1 Configuration Parameters Dialog Box
In this section...
“Data Import/Export Overview” on page 1-78
“Input” on page 1-79
“Initial State” on page 1-81
“Time” on page 1-83
“States” on page 1-85
“Output” on page 1-87
“Final states” on page 1-89
“Save complete SimState in final state” on page 1-91
“Signal logging” on page 1-94
“Inspect signal logs when simulation is paused/stopped” on page 1-96
“Limit data points to last” on page 1-98
1-76
Data Import/Export Pane
In this section...
“Decimation” on page 1-100
“Format” on page 1-102
“Output options” on page 1-104
“Refine factor” on page 1-106
“Output times” on page 1-108
“Return as Single Object” on page 1-109
1-77
1 Configuration Parameters Dialog Box
Configuration
Tips
• For more information on using this pane, see Importing and Exporting
Simulation Data.
• See the documentation of the sim command for some capabilities that are
available only for programmatic simulation.
See Also
1-78
Data Import/Export Pane
Input
Loads input data from a workspace before the simulation begins.
Settings
Default: Off, [t,u]
On
Loads data from a workspace.
Tips
• You must select the Input check box before entering input data.
• Simulink software linearly interpolates or extrapolates input values as
necessary if the Interpolate data option is selected for the corresponding
Inport.
• The use of the Input box is independent of the setting of the Format list
on the Data Import/Export pane.
• Limitation: You cannot load fixed-point data that is contained in a
structure. Consider using a Simulink.Timeseries object instead of a
structure.
1-79
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: LoadExternalInput
Type: string
Value: 'on' | 'off'
Default: 'off'
Parameter: ExternalInput
Type: scalar or vector
Value: any valid value
Default: [t,u]
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-80
Data Import/Export Pane
Initial State
Loads the model’s initial states from a workspace before simulation begins.
Settings
Default: Off, xInitial
On
Simulink software loads initial states from a workspace.
Specify the name of a variable that contains the initial state values, for
example, a variable containing states saved from a previous simulation.
Off
Simulink software does not load initial states from a workspace.
Tips
• You must select the Initial State check box before entering initial state
data.
• The initial values specified by the workspace variable override the initial
values specified by the model itself (the values specified by the initial
condition parameters of those blocks in the model that have states).
• You must use the structure or structure-with-time format to initialize the
states of a top model and the models that it references.
1-81
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: LoadInitialState
Type: string
Value: 'on' | 'off'
Default: 'off'
Parameter: InitialState
Type: variable (string) or vector
Value: any valid value
Default: 'xInitial'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-82
Data Import/Export Pane
Time
Saves simulation time data to the specified variable during simulation.
Settings
Default: On, tout
On
Simulink software exports time data to the MATLAB workspace during
simulation.
Specify the name of the MATLAB variable used to store time data. See
Exporting Data to the MATLAB Workspace for more information.
Off
Simulink software does not export time data to the MATLAB workspace
during simulation.
Tips
• You must select the Time check box before entering the time variable.
• Simulink software saves the output to the MATLAB workspace at the base
sample rate of the model. Use a To Workspace block if you want to save
output at a different sample rate.
• The Save options area enables you to specify the format and restrict the
amount of output saved.
Command-Line Information
Parameter: SaveTime
Type: string
Value: 'on' | 'off'
Default: 'on'
Parameter: TimeSaveName
Type: string
Value: any valid value
Default: 'tout'
1-83
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-84
Data Import/Export Pane
States
Saves state data to the specified MATLAB variable during a simulation.
Settings
Default: Off, xout
On
Simulink software exports state data to the MATLAB workspace during
simulation.
Specify the name of the MATLAB variable used to store state data. See
Importing and Exporting States for more information.
Off
Simulink software does not export state data during simulation.
Tips
• You must select the States check box before entering the states variable.
• Simulink software saves the states in a MATLAB workspace variable
having the specified name.
• The saved data has the format that you specify in the Save options area.
Command-Line Information
Parameter: SaveState
Type: string
Value: 'on' | 'off'
Default: 'off'
Parameter: StateSaveName
Type: string
Value: any valid value
Default: 'xout'
1-85
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-86
Data Import/Export Pane
Output
Saves signal data to the specified MATLAB variable during simulation.
Settings
Default: On, yout
On
Simulink software exports signal data to the MATLAB workspace
during simulation.
Specify the name of the MATLAB variable used to store signal data. See
Exporting Data to the MATLAB Workspace for more information.
Off
Simulink software does not export signal data during simulation.
Tips
• You must select the Output check box before entering the output variable.
• Simulink software saves the output to the MATLAB workspace at the base
sample rate of the model. Use a To Workspace block if you want to save
output at a different sample rate.
• The Save options area enables you to specify the format and restrict the
amount of output saved.
Command-Line Information
Parameter: SaveOutput
Type: string
Value: 'on' | 'off'
Default: 'on'
Parameter: OutputSaveName
Type: string
Value: any valid value
Default: 'yout'
1-87
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-88
Data Import/Export Pane
Final states
Saves the model’s logged states at the end of a simulation to the specified
MATLAB variable.
Settings
Default: Off, xFinal
On
Simulink software exports final logged state data to the MATLAB
workspace during simulation.
Specify the name of the MATLAB variable in which to store the values
of these final states. See Importing and Exporting States for more
information.
Off
Simulink software does not export the final state data during simulation.
Tips
• You must select the Final states check box before entering the final states
variable.
• Simulink software saves the final states in a MATLAB workspace variable
having the specified name.
• The saved data has the format that you specify in the Save options area.
Command-Line Information
Parameter: SaveFinalState
Type: string
Value: 'on' | 'off'
Default: 'off'
Parameter: FinalStateName
Type: string
Value: any valid value
Default: 'xFinal'
1-89
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-90
Data Import/Export Pane
Settings
Default: Off, xFinal
On
Simulink software exports the complete set of final state data (i.e., the
SimState) to the MATLAB workspace during simulation.
Specify the name of the MATLAB variable in which to store the values
of the final states. See Importing and Exporting States for more
information.
Off
Simulink software exports the final logged states during simulation.
Tips
• You must select the Final states check box to enable the Save complete
SimState in final state option.
• Simulink saves the final states in a MATLAB workspace variable having
the specified name.
• The saved data has the format that you specify in the Save options area.
Dependencies
This parameter is enabled by Final states.
Command-Line Information
Parameter: SaveCompleteFinalSimState
Type: string
Value: 'on' | 'off'
Default: 'off'
Parameter: FinalStateName
1-91
1 Configuration Parameters Dialog Box
Type: string
Value: any valid value
Default: 'xFinal'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-92
1 Configuration Parameters Dialog Box
1-93
1 Configuration Parameters Dialog Box
Signal logging
Globally enable or disable signal logging for this model.
Settings
Default: On, logsout
On
Enables signal logging to the MATLAB workspace during simulation.
Specify the name of the signal logging object used to record logged
signal data in the MATLAB workspace. See Logging Signals for more
information.
Off
Disables signal logging to the MATLAB workspace during simulation.
Tips
• You must select the Signal logging check box before entering the signal
logging variable.
• Simulink software saves the signal data in a MATLAB workspace variable
having the specified name.
• The saved data has the format that you specify in the Save options area.
• Simulink software does not support signal logging for the following types of
signals:
- Output of a Function-Call Generator block
- Signal connected to the input of a Merge block
- Outputs of Trigger and Enable blocks
Dependencies
This parameter enables Inspect signal logs when simulation is
paused/stopped.
1-94
Data Import/Export Pane
Command-Line Information
Parameter: SignalLogging
Type: string
Value: 'on' | 'off'
Default: 'on'
Parameter: SignalLoggingName
Type: string
Value: any valid value
Default: 'logsOut'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
• Logging Signals
• Configuration Parameters Dialog Box
• Data Import/Export Pane
1-95
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Simulink software displays logged signals in the MATLAB Time Series
Tools viewer at the end of a simulation or whenever you pause the
simulation.
Off
Simulink software does not display logged signals at the end of a
simulation.
Tips
• If this option is off, you must select Tools > Inspect logged signals in the
model editor to display logged signals in the Time Series Tools viewer.
• You must run the simulation before selecting Tools > Inspect logged
signals. Otherwise, the command has no effect.
Dependencies
This parameter is enabled by Signal logging.
Command-Line Information
Parameter: InspectSignalLogs
Type: string
Value: 'on' | 'off'
Default: 'off'
1-96
Data Import/Export Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
• Logging Signals
• Configuration Parameters Dialog Box
• Data Import/Export Pane
1-97
1 Configuration Parameters Dialog Box
Settings
Default: On, 1000
On
Limits the number of data points exported to the MATLAB workspace
to the number specified.
Off
Does not limit the number of data points.
Tips
• You must select the Limit data points to last check box before specifying
the number of data points.
• Saving data to the MATLAB workspace can slow down the simulation
and consume memory. Use this parameter to limit the number of samples
saved to help avoid this problem.
• You can also apply a Decimation factor to skip a selected number of
samples.
1-98
Data Import/Export Pane
Command-Line Information
Parameter: LimitDataPoints
Type: string
Value: 'on' | 'off'
Default: 'on'
Parameter: MaxDataPoints
Type: string
Value: any valid value
Default: '1000'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-99
1 Configuration Parameters Dialog Box
Decimation
Specify that Simulink software output only every N points, where N is the
specified decimation factor.
Settings
Default: 1
• The default value (1) specifies that all data points are saved.
• Simulink software outputs data only at the specified number of data points.
For example, specifying 2 saves every other data point, while specifying 10
saves just one in ten data points.
• At the end of the simulation, the total number of data points is reduced by
the factor specified.
Tips
• Saving data to the MATLAB workspace can slow down the simulation
and consume memory. Use this parameter to limit the number of samples
saved to help avoid this problem.
• You can also use the Limit data points to last parameter to help resolve
this problem.
Command-Line Information
Parameter: Decimation
Type: string
Value: any valid value
Default: '1'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-100
Data Import/Export Pane
Application Setting
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-101
1 Configuration Parameters Dialog Box
Format
Select the format of state and output data saved to the MATLAB workspace.
Settings
Default: Array
Array
The format of the data is a matrix each row of which corresponds to a
simulation time step.
Structure
The format of the data is a structure that contains substructures
for each port. Each port substructure contains signal data for the
corresponding port.
Structure with time
The format of the data is a structure that has two fields: a time field
and a signals field. The time field contains a vector of simulation
times. The signals field contains a substructure for each model input
port (for imported data) or output port (for exported data). Each port
substructure contains signal data for the corresponding port.
Tips
• You can use array format to save your model’s outputs and states only if
the outputs are either all scalars or all vectors (or all matrices for states),
are either all real or all complex, and are all of the same data type. Use the
Structure or Structure with time output formats (see Structure with
time) if your model’s outputs and states do not meet these conditions.
• Simulink software can read back simulation data saved to the workspace in
the Structure with time output format. See Importing Signal-and-Time
Data Structures for more information.
1-102
Data Import/Export Pane
Command-Line Information
Parameter: SaveFormat
Type: string
Value: 'Array' | 'Structure' | 'StructureWithTime'
Default: 'Array'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-103
1 Configuration Parameters Dialog Box
Output options
Select options for generating additional output signal data for variable-step
solvers.
Settings
Default: Refine output
Refine output
Generates data output between as well as at simulation times steps.
Use Refine factor to specify the number of points to generate between
simulation time steps. For more information, see Refining Output.
Produce additional output
Generates additional output at specified times. Use Output times
to specify the simulation times at which Simulink software should
generate additional output.
Produce specified output only
Generates output only at specified times. Use Output times to specify
the simulation times at which Simulink software should generate
output.
Tips
• These settings can force the solver to calculate output values for times that
it would otherwise have omitted because the calculations were not needed
to achieve accurate simulation results. These extra calculations can cause
the solver to locate zero crossings that it would otherwise have missed.
• For additional information on how Simulink software calculates outputs for
these three options, see Specifying Output Options.
Dependencies
This parameter is enabled only if the model specifies a variable-step solver
(see Solver Type).
1-104
Data Import/Export Pane
Command-Line Information
Parameter: OutputOption
Type: string
Value: 'RefineOutputTimes' | 'AdditionalOutputTimes' |
'SpecifiedOutputTimes'
Default: 'RefineOutputTimes'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
1-105
1 Configuration Parameters Dialog Box
Refine factor
Specify how many points to generate between time steps to refine the output.
Settings
Default: 1
• The default refine factor is 1, meaning that no extra data points are
generated.
• A refine factor of 2 provides output midway between the time steps, as
well as at the steps.
Tip
Simulink software ignores this option for discrete models. This is because the
value of data between time steps is undefined for discrete models.
Dependency
This parameter is enabled only if you select Refine output as the value
of Output options.
Command-Line Information
Parameter: Refine
Type: string
Value: any valid value
Default: '1'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-106
Data Import/Export Pane
Application Setting
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
• Refining Output
• Configuration Parameters Dialog Box
• Data Import/Export Pane
1-107
1 Configuration Parameters Dialog Box
Output times
Specify times at which Simulink software should generate output in addition
to, or instead of, the times of the simulation steps taken by the solver used
to simulate the model.
Settings
Default: []
Tips
Dependency
This parameter is enabled only if the value of Output options is Produce
additional output or Produce specified output only.
1-108
Data Import/Export Pane
Command-Line Information
Parameter: OutputTimes
Type: string
Value: any valid value
Default: '[]'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development
Off for production code generation
See Also
• Refining Output
• Configuration Parameters Dialog Box
• Data Import/Export Pane
Settings
Default: off
• Turning this option ’on’ directs Simulink to return all simulation outputs
within a single Simulink.SimulationOutput object.
• Enabling this option makes the sim command compatible with the parfor
command, in terms of transparency issues.
1-109
1 Configuration Parameters Dialog Box
Tips
Command-Line Information
Parameter: ReturnWorkspaceOutputs
Type: string
Value: 'on' | 'off' |
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-110
Optimization Pane
Optimization Pane
The Optimization pane includes the following parameters:
The Optimization pane includes the following parameters when the Real-Time
Workshop product is installed on your system and you select a GRT-based
target.
1-111
1 Configuration Parameters Dialog Box
The Optimization pane includes the following parameters when the Real-Time
Workshop product is installed on your system and you select an ERT-based
target. ERT-based target optimizations require a Real-Time Workshop®
Embedded Coder™ license when generating code.
1-112
Optimization Pane
1-113
1 Configuration Parameters Dialog Box
In this section...
“Optimization Overview” on page 1-116
“Block reduction” on page 1-117
“Conditional input branch execution” on page 1-121
“Inline parameters” on page 1-123
“Implement logic signals as Boolean data (vs. double)” on page 1-126
“Signal storage reuse” on page 1-128
“Application lifespan (days)” on page 1-130
“Use integer division to handle net slopes that are reciprocals of integers”
on page 1-133
“Parameter structure” on page 1-135
“Enable local block outputs” on page 1-137
“Ignore integer downcasts in folded expressions” on page 1-140
“Eliminate superfluous local variables (Expression folding)” on page 1-143
“Minimize data copies between local and global variables” on page 1-145
“Simplify array indexing” on page 1-147
“Reuse block outputs” on page 1-149
“Inline invariant signals” on page 1-152
“Pack Boolean data into bitfields” on page 1-154
“Loop unrolling threshold” on page 1-156
“Use memcpy for vector assignment” on page 1-158
“Memcpy threshold (bytes)” on page 1-160
“Pass reusable subsystem outputs as” on page 1-162
“Remove root level I/O zero initialization” on page 1-164
“Use memset to initialize floats and doubles to 0.0” on page 1-166
“Remove internal data zero initialization” on page 1-168
“Optimize initialization code for model reference” on page 1-170
1-114
Optimization Pane
In this section...
“Remove code from floating-point to integer conversions that wraps
out-of-range values” on page 1-172
“Remove code from floating-point to integer conversions with saturation
that maps NaN to zero” on page 1-174
“Remove code that protects against division arithmetic exceptions” on
page 1-176
“Use bitsets for storing state configuration” on page 1-178
“Use bitsets for storing Boolean data” on page 1-180
“Model Parameter Configuration Dialog Box” on page 1-182
“Compiler optimization level” on page 1-184
“Verbose accelerator builds” on page 1-186
1-115
1 Configuration Parameters Dialog Box
Optimization Overview
Set up optimizations for a model’s active configuration set. Optimizations are
set for both simulation and code generation.
Configuration
Set the parameters displayed.
Tips
See Also
1-116
Optimization Pane
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
1-117
1 Configuration Parameters Dialog Box
1-118
Optimization Pane
Command-Line Information
Parameter: BlockReduction
Type: string
Value: 'on' | 'off'
Default: 'on'
1-119
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging Off (for simulation and during
development)
No impact (for production code generation)
Traceability Off
Efficiency On
Safety precaution Off
See Also
• Block Reduction
• Single-Tasking Execution
• Optimizing a Model for Code Generation
• Configuration Parameters Dialog Box
• Optimization Pane
1-120
Optimization Pane
Settings
Default: On
On
Executes only the blocks required to compute the control input and
the data input selected by the control input. This optimization speeds
execution of code generated from the model. Limits to Switch block
optimization:
• Only blocks with -1 (inherited) or inf (Constant) sample time can
participate.
• Blocks with outputs flagged as test points cannot participate.
• No multirate block can participate.
• Blocks with states cannot participate.
• Only S-functions with option
SS_OPTION_CAN_BE_CALLED_CONDITIONALLY set can participate.
Off
Executes all blocks driving the Switch block input ports at each time
step.
Command-Line Information
Parameter: ConditionallyExecuteInputs
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
1-121
1 Configuration Parameters Dialog Box
Application Setting
Traceability On
Efficiency On
Safety precaution Off
See Also
• Expression Folding
• Conditional Input Execution
• Optimizing a Model for Code Generation
• Configuration Parameters Dialog Box
• Optimization Pane
1-122
Optimization Pane
Inline parameters
Transform tunable parameters into constant values.
Settings
Default: Off
On
Selecting 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.
• Enables the Configure button. Clicking the Configure button
opens the Model Parameter Configuration dialog box.
Off
Uses symbolic names for model parameters in generated code.
Tips
1-123
1 Configuration Parameters Dialog Box
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 model uses referenced models:
- All referenced models must specify Inline parameters to be on.
- The top model can specify Inline parameters to be on or off.
See Inline Parameter Requirements for more information.
• If your model contains an Environment Controller block, you can suppress
code generation for the branch connected to the Sim port if you select
Inline parameters and the branch does not contain external signals.
Dependencies
This parameter enables:
• Configure button
• “Parameter structure” on page 1-135
• “Inline invariant signals” on page 1-152
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
1-124
Optimization Pane
See Also
1-125
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Blocks that generate logic signals output a signal of boolean data type.
This reduces the memory requirements of generated code.
Off
Blocks that generate logic signals output a signal of double data type.
This ensures compatibility with models created by earlier versions of
Simulink software.
Tips
1-126
Optimization Pane
Dependencies
Command-Line Information
Parameter: BooleanDataType
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution On
See Also
1-127
1 Configuration Parameters Dialog Box
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
Dependencies
This parameter enables:
1-128
Optimization Pane
Command-Line Information
Parameter:OptimizeBlockIOStorage
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution No impact
See Also
1-129
1 Configuration Parameters Dialog Box
Settings
Default: inf
Min: Must be greater than zero
Max: inf
If you are licensed for the Real-Time Workshop Embedded Coder product
and select an ERT target for your model, the default value for Application
lifespan (days) is 1.
This parameter is ignored when you are operating your model in external
mode, have Mat-file logging enabled, or have a continuous sample time
because a 64 bit timer is required in these cases.
Tips
• Specifying a lifespan, along with the simulation step size, determines the
data type used by blocks to store absolute time values.
• For simulation, setting this parameter to a value greater than the
simulation time will ensure time does not overflow.
• Simulink software evaluates this parameter first against the model
workspace. If this does not resolve the parameter, Simulink software then
evaluates it against the base workspace.
• The Application lifespan also determines the word size used by timers in
the generated code, which can lower RAM usage. For more information, see
Timing Services in the Real-Time Workshop documentation.
• Application lifespan, when combined with the step size of each task,
determines the data type used for integer absolute time for each task, as
follows:
- If your model does not require absolute time, this option affects neither
simulation nor the generated code.
1-130
Optimization Pane
- If your model requires absolute time, this option optimizes the word size
used for storing integer absolute time in generated code. This ensures
that timers do not overflow within the lifespan you specify. If you set
Application lifespan to inf, two uint32 words are used.
- If your model contains fixed-point blocks that require absolute time, this
option affects both simulation and generated code.
For example, using 64 bits to store timing data enables models with a step
size of 0.001 microsecond (10E-09 seconds) to run for more than 500 years,
which would rarely be required. To run a model with a step size of one
millisecond (0.001 seconds) for one day would require a 32-bit timer (but it
could continue running for 49 days).
• A timer will allocate 64 bits of memory if you specify a value of inf.
• To minimize the amount of RAM used by time counters, specify a lifespan
no longer than necessary.
• Must be the same for top and referenced models.
• Optimize the size of counters used to compute absolute and elapsed time.
Command-Line Information
Parameter: LifeSpan
Type: string
Value: positive (nonzero) scalar value or inf
Default: 'inf'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency Finite value
Safety precaution inf
1-131
1 Configuration Parameters Dialog Box
See Also
• Timing Services
• Using Timers in Asynchronous Tasks
• Optimizing a Model for Code Generation
• Configuration Parameters Dialog Box
• Optimization Pane
1-132
Optimization Pane
Settings
Default: Off
On
Perform net slope correction using integer division when simplicity
and accuracy conditions are met.
Off
Perform net slope correction using integer multiplication followed by
shifts.
Tips
1-133
1 Configuration Parameters Dialog Box
Dependency
This parameter requires a Simulink Fixed Point license.
Command-Line Information
Parameter: UseIntDivNetSlope
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On (when target hardware supports
efficient division)
Off (otherwise)
Safety precaution No impact
See Also
1-134
Optimization Pane
Parameter structure
Control how parameter data is generated for reusable subsystems.
Settings
Default: Hierarchical
Hierarchical
Generates a separate header file, defining an independent parameter
structure, for each subsystem that meets the following conditions:
• The subsystem’s Real-Time Workshop system code parameter is
set to Reusable function.
• The subsystem does not violate any code reuse limitations.
• The subsystem does not access parameters other than its own (such
as parameters of the root-level model).
Dependencies
Command-Line Information
Parameter: InlinedParameterPlacement
Type: string
Value: 'Hierarchical' | 'NonHierarchical'
1-135
1 Configuration Parameters Dialog Box
Default: 'Hierarchical'
Recommended Settings
Application Setting
Debugging No impact
Traceability Hierarchical
Efficiency NonHierarchical
Safety precaution No impact
See Also
1-136
Optimization Pane
Settings
Default: On
On
Block signals are declared locally in functions.
Off
Block signals are declared globally.
Tips
Dependencies
Command-Line Information
Parameter: LocalBlockOutputs
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging Off
1-137
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
1-138
1 Configuration Parameters Dialog Box
1-139
1 Configuration Parameters Dialog Box
Settings
Default: Off (GUI), 'on' (command-line)
On
Real-Time Workshop software collapses block computations into a single
expression, avoiding casts of intermediate variables.
Off
Explicitly downcasts the results of 8- and 16-bit integer expressions.
Tips
Dependency
This parameter requires a Real-Time Workshop license.
Command-Line Information
Parameter: EnforceIntegerDowncast
Type: string
Value: 'on' | 'off'
1-140
Optimization Pane
Default: 'on'
Note The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description of “Off” in the
settings section, and 'off' in the command line corresponds to the description
of “On” in the settings section.
Recommended Settings
Application Setting
Debugging Off
Traceability No impact
Efficiency No impact
Safety precaution Off
See Also
1-141
1 Configuration Parameters Dialog Box
1-142
Optimization Pane
Settings
Default: On
On
• Enables expression folding.
• Eliminates local variables, incorporating the information into the
main code statement.
• Improves code readability and efficiency.
Off
Disables expression folding.
Dependencies
Command-Line Information
Parameter: ExpressionFolding
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging Off
1-143
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact (for simulation and during
development)
Off (for production code generation)
Efficiency On
Safety precaution No impact
See Also
• Expression Folding
• Optimizing a Model for Code Generation
• Configuration Parameters Dialog Box
• Optimization Pane
1-144
Optimization Pane
Settings
Default: Off
On
Writes data for block outputs to global variables, reducing RAM
consumption and execution time.
Off
Writes data for block outputs to local variables.
Dependencies
Command-Line Information
Parameter: EnhancedBackFolding
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution On
1-145
1 Configuration Parameters Dialog Box
See Also
• “Signal Considerations”
• “Optimizing Generated Code”
• Configuration Parameters Dialog Box
• Optimization Pane
1-146
Optimization Pane
Settings
Default: Off
On
In array indices, replace multiply operations with add operations when
accessing arrays in a loop in the generated code. When the original
signal is multidimensional, the Real-Time Workshop Embedded Coder
generates one-dimensional arrays, resulting in multiply operations
in the array indices. Using this setting eliminates costly multiply
operations when accessing arrays in a loop in the C/C++ program.
This optimization (commonly referred to as strength reduction) is
particularly useful if the C/C++ compiler on the target platform does
not have similar functionality. No appearance of multiply operations
in the C/C++ program does not imply that the C/C++ compiler does
not generate multiply instructions.
Off
Leave multiply operations in array indices when accessing arrays in
a loop.
Dependencies
This parameter:
Command-Line Information
Parameter: StrengthReduction
Type: string
Value: 'on' | 'off'
Default: 'off'
1-147
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
1-148
Optimization Pane
Settings
Default: On
On
• Real-Time Workshop software reuses signal memory whenever
possible, reducing stack size where signals are being buffered in
local variables.
• Selecting this parameter trades code traceability for code efficiency.
Off
Signals are stored in unique locations.
Dependencies
Command-Line Information
Parameter: BufferReuse
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution No impact
1-149
1 Configuration Parameters Dialog Box
See Also
1-150
1 Configuration Parameters Dialog Box
1-151
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Real-Time Workshop software uses the numerical values of model
parameters, instead of their symbolic names, in generated code. An
invariant signal is not inlined if it is nonscalar, complex, or the block
inport the signal is attached to takes the address of the signal.
Off
Uses symbolic names of model parameters in generated code.
Dependencies
Command-Line Information
Parameter: InlineInvariantSignals
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution No impact
1-152
Optimization Pane
See Also
Inlining Invariant Signals
1-153
1 Configuration Parameters Dialog Box
Note You cannot use this optimization when you generate code for a target
that specifies an explicit structure alignment.
Settings
Default: Off
On
Stores Boolean signals into one–bit bitfields in global block I/O
structures or DWork vectors. This will reduce RAM, but might cause
more executable code.
Off
Stores Boolean signals as a Boolean data type in global block I/O
structures or DWork vectors.
Dependencies
This parameter:
Command-Line Information
Parameter: BooleansAsBitfields
Type: string
Value: 'on' | 'off'
Default: 'off'
1-154
Optimization Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
“Optimization Pane” on page 1-111
1-155
1 Configuration Parameters Dialog Box
Settings
Default: 5
Specify the array size at which the code generator begins to use a for loop
instead of separate assignment statements to assign values to the elements of
a signal or parameter array.
When there are perfectly nested loops, the code generator uses a for loop if
the product of the loop counts for all loops in the perfect loop nest is greater
than or equal to the threshold.
Dependency
This parameter requires a Real-Time Workshop license.
Command-Line Information
Parameter: RollThreshold
Type: string
Value: any valid value
Default: '5'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency >0
Safety precaution >1
1-156
Optimization Pane
See Also
1-157
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Enables use of memcpy for vector assignment based on the associated
threshold parameter Memcpy threshold (bytes). memcpy is used in
the generated code if the number of array elements times the number
of bytes per element is greater than or equal to the specified value for
Memcpy threshold (bytes). One byte equals the width of a character
in this context.
Off
Disables use of memcpy for vector assignment.
Dependencies
Command-Line Information
Parameter: EnableMemcpy
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-158
Optimization Pane
Application Setting
Efficiency On
Safety precaution No impact
See Also
1-159
1 Configuration Parameters Dialog Box
Settings
Default: 64
Specify the array size, in bytes, at which the code generator begins to use
memcpy instead of for loops for vector assignments.
Dependencies
Command-Line Information
Parameter: MemcpyThreshold
Type: integer
Value: any valid quantity of bytes
Default: 64
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency Accept default or determine target-specific
optimal value
Safety precaution No impact
1-160
Optimization Pane
See Also
1-161
1 Configuration Parameters Dialog Box
Settings
Default: Structure reference
Structure reference
Passes reusable subsystem outputs as a pointer to a structure stored in
global memory.
Individual arguments
Passes each reusable subsystem output argument as an address of a
local, instead of as a pointer to an area of global memory containing
all output arguments. This option reduces global memory usage and
eliminates copying local variables back to global block I/O structures.
When the signals are allocated as local variables, there may be an
increase in stack size. If the stack size increases beyond a level that
you want, use the default setting. The maximum number of output
arguments passed individually is 12.
Note The default option is used for reusable subsystems that have signals
with variable dimensions.
Dependencies
This parameter:
Command-Line Information
Parameter: PassReuseOutputArgsAs
Type: string
Value: 'Structure reference' | 'Individual arguments'
Default: 'Structure reference'
1-162
Optimization Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency Individual arguments
Safety precaution No impact
See Also
1-163
1 Configuration Parameters Dialog Box
Settings
Default: Off (GUI), 'on' (command-line)
On
Does not generate initialization code for root-level inports and outports
set to zero.
Off
Generates initialization code for all root-level inports and outports. You
should use the default:
• To ensure that memory allocated for C MEX S-function wrappers
is initialized to zero
• For safety-critical applications that require that all internal and
external data be initialized to zero
Dependencies
Command-Line Information
Parameter: ZeroExternalMemoryAtStartup
Type: string
Value: 'off' | 'on'
Default: 'on'
1-164
Optimization Pane
Note The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description of “Off” in the
settings section, and 'off' in the command line corresponds to the description
of “On” in the settings section.
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution Off
See Also
1-165
1 Configuration Parameters Dialog Box
Settings
Default: On (GUI), 'off' (command-line)
On
Uses memset to clear internal storage for floating-point data to integer
bit pattern 0 (all bits 0), regardless of type. An example of a case for
selecting this option is to gain compiler efficiency when the compiler
and target CPU both represent floating-point zero with the integer bit
pattern 0.
Off
Generates code to explicitly initialize storage for data of types float
and double to 0.0. The resulting code is slightly less efficient than code
generated when you select the option.
You should not select this option if you need to ensure that memory
allocated for C MEX S-function wrappers is initialized to zero.
Dependency
This parameter requires a Real-Time Workshop license.
Command-Line Information
Parameter: InitFltsAndDblsToZero
Type: string
Value: 'on' | 'off'
Default: 'off'
Note The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description of “Off” in the
settings section, and 'off' in the command line corresponds to the description
of “On” in the settings section.
1-166
Optimization Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On (GUI), 'off' (command-line)
Safety precaution No impact
See Also
1-167
1 Configuration Parameters Dialog Box
Settings
Default: Off (GUI), 'on' (command-line)
On
Does not generate code that initializes internal work structures to zero.
An example of when you might select this parameter is to test the
behavior of a design during warm boot—a restart without full system
reinitialization.
Dependencies
1-168
Optimization Pane
Command-Line Information
Parameter: ZeroInternalMemoryAtStartup
Type: string
Value: 'off' | 'on'
Default: 'on'
Note The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description of “Off” in the
settings section, and 'off' in the command line corresponds to the description
of “On” in the settings section.
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution Off
See Also
1-169
1 Configuration Parameters Dialog Box
Settings
Default: on
On
Suppresses generation of initialization code for blocks that have states
unless the blocks are 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 states. If you violate this constraint, Simulink software
reports an error, in which case you can disable this optimization.
Off
Generates initialization code for all blocks that have states. Disable this
option if the current model includes a subsystem that resets states, such
as an enabled subsystem, and the model is referred to from another
model with a Model block.
Dependencies
Command-Line Information
Parameter: OptimizeModelRefInitCode
Type: string
Value: 'on' | 'off'
Default: 'on'
1-170
Optimization Pane
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
1-171
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Removes code when out-of-range conversions occur. Select this check
box if code efficiency is critical to your application and the following
conditions are true for at least one block in the model:
• Computing the outputs or parameters of a block involves converting
floating-point data to integer or fixed-point data.
• The Saturate on integer overflow check box is cleared in the
Block Parameters dialog box.
Off
Results for simulation and execution of generated code match when
out-of-range conversions occur. The generated code is larger than when
you select this check box.
Tips
• Selecting this check box reduces the size and increases the speed of the
generated code at the cost of potentially producing results that do not
match simulation in the case of out-of-range values.
• Selecting this check box affects code generation results only for out-of-range
values and cannot cause code generation results to differ from simulation
results for in-range values.
1-172
Optimization Pane
Dependency
This parameter requires a Real-Time Workshop license.
Command-Line Information
Parameter: EfficientFloat2IntCast
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution Off (for simulation and during
development)
On (for production code generation)
See Also
1-173
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Removes code when mapping from NaN to integer zero occurs. Select
this check box if code efficiency is critical to your application and the
following conditions are true for at least one block in the model:
• Computing outputs or parameters of a block involves converting
floating-point data to integer or fixed-point data.
• The Saturate on integer overflow check box is selected in the
Block Parameters dialog box.
Off
Results for simulation and execution of generated code match when
mapping from NaN to integer zero occurs. The generated code is larger
than when you select this check box.
Tips
• Selecting this check box reduces the size and increases the speed of the
generated code at the cost of producing results that do not match simulation
in the case of NaN values.
• Selecting this check box affects code generation results only for NaN values
and cannot cause code generation results to differ from simulation results
for any other values.
1-174
Optimization Pane
Dependencies
Command-Line Information
Parameter: EfficientMapNaN2IntZero
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency On
Safety precaution Off (for simulation and during
development)
On (for production code generation)
See Also
1-175
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Does not generate code that guards against division by zero for
fixed-point data. When you select this option, simulation results and
results from generated code might not be in bit-for-bit agreement.
Off
Generates code that guards against division by zero for fixed-point data.
Dependencies
Command-Line Information
Parameter: NoFixptDivByZeroProtection
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-176
Optimization Pane
Application Setting
Efficiency On
Safety precaution Off
See Also
1-177
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Stores state configuration variables in bitsets. Potentially reduces the
amount of memory required to store the variables. Potentially requires
more instructions to access state configuration, which can result in
less optimal code.
Off
Stores state configuration variables in unsigned bytes. Potentially
increases the amount of memory required to store the variables.
Potentially requires fewer instructions to access state configuration,
which can result in more optimal code.
Tips
• Selecting this check box can significantly reduce the amount of memory
required to store the variables. However, it can increase the amount of
memory required to store target code if the target processor does not
include instructions for manipulating bitsets.
• Select this check box for Stateflow charts that have a large number of
sibling states at a given level of the hierarchy.
• Clear this check box for Stateflow charts with a small number of sibling
states at a given level of the hierarchy.
Dependency
This parameter requires a Stateflow license.
Command-Line Information
Parameter: StateBitsets
1-178
Optimization Pane
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency Off
Safety precaution No impact
See Also
1-179
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Stores Boolean data in bitsets. Potentially reduces the amount
of memory required to store the data. Potentially requires more
instructions to access the data, which can result in less optimal code.
Off
Stores Boolean data in unsigned bytes. Potentially increases the
amount of memory required to store the data. Potentially requires fewer
instructions to access the data, which can result in more optimal code.
Tips
• Select this check box for Stateflow charts that reference Boolean data
infrequently.
• Clear this check box for Stateflow charts that reference Boolean data
frequently.
Dependency
This parameter requires a Stateflow license.
Command-Line Information
Parameter: DataBitsets
Type: string
Value: 'on' | 'off'
Default: 'off'
1-180
Optimization Pane
Recommended Settings
Application Setting
Debugging Off
Traceability Off
Efficiency Off
Safety precaution No impact
See Also
1-181
1 Configuration Parameters Dialog Box
Note Simulink software ignores the settings of this dialog box if a model
contains references to other models. However, you can still tune parameters
of such models, using Simulink.Parameter objects (see “Inline Parameter
Requirements” for more information).
Source list
Displays a list of workspace variables. The options are:
• MATLAB workspace
1-182
Optimization Pane
Lists all variables in the MATLAB workspace that have numeric values.
• Referenced workspace variables
Lists only those variables referenced by the model.
Refresh list
Updates the source list. Click this button if you have added a variable to the
workspace since the last time the list was displayed.
Add to table
Adds the variables selected in the source list to the adjacent table of tunable
parameters.
New
Defines a new parameter and adds it to the list of tunable parameters. Use
this button to create tunable parameters that are not yet defined in the
MATLAB workspace.
Note This option does not create the corresponding variable in the MATLAB
workspace. You must create the variable yourself.
Storage class
Used for code generation. See the Real-Time Workshop User’s Guide for more
information.
1-183
1 Configuration Parameters Dialog Box
Settings
Default: Optimizations off (faster builds)
Tips
• The default Optimizations off is a good choice for most models. This
quickly produces code that can be used with acceleration.
• Set Optimizations on to optimize your code. The fast running code
produced by optimization can be advantageous if you will repeatedly run
your model with the accelerator.
Command-Line Information
Parameter: SimCompilerOptimization
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-184
Optimization Pane
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
• “Accelerating Models”
• “Interacting with the Acceleration Modes Programmatically”
• “Customizing the Acceleration Build Process”
1-185
1 Configuration Parameters Dialog Box
Settings
Default: Off
Off
Display limited amount of information during the code generation
process.
On
Display progress information during code generation, and show the
compiler options in use.
Command-Line Information
Parameter: AccelVerboseBuild
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
For more information about AccelVerboseBuild, see “Controlling Verbosity
During Code Generation”.
1-186
Diagnostics Pane: Solver
In this section...
“Solver Diagnostics Overview” on page 1-189
“Algebraic loop” on page 1-190
“Minimize algebraic loop” on page 1-192
“Block priority violation” on page 1-194
“Min step size violation” on page 1-196
“Sample hit time adjusting” on page 1-198
“Consecutive zero-crossings violation” on page 1-200
“Unspecified inheritability of sample time” on page 1-202
“Solver data inconsistency” on page 1-204
“Automatic solver parameter selection” on page 1-206
“Extraneous discrete derivative signals” on page 1-208
1-187
1 Configuration Parameters Dialog Box
In this section...
“State name clash” on page 1-210
“SimState interface checksum mismatch:” on page 1-211
1-188
Diagnostics Pane: Solver
Configuration
Set the parameters displayed.
Tips
See Also
1-189
1 Configuration Parameters Dialog Box
Algebraic loop
Select the diagnostic action to take if Simulink software detects an algebraic
loop while compiling the model.
Settings
Default: warning
none
Simulink software does not check for algebraic loops.
warning
When Simulink software detects an algebraic loop, it displays a warning.
error
When Simulink software detects an algebraic loop, it terminates the
simulation, displays an error message, and highlights the portion of the
block diagram that comprises the loop.
Tips
1-190
Diagnostics Pane: Solver
blocks and lines that constitute the loops. Closing the error dialog restores
the diagram to its original colors.
• See Algebraic Loops for more information.
Command-Line Information
Parameter: AlgebraicLoopMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging error
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
• Algebraic Loops
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Diagnostics Pane: Solver
1-191
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: ArtificialAlgebraicLoopMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
1-192
Diagnostics Pane: Solver
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
• Algebraic Loops
• Diagnosing Simulation Errors
• Working with Test Points
• Configuration Parameters Dialog Box
• Diagnostics Pane: Solver
1-193
1 Configuration Parameters Dialog Box
Settings
Default: warning
warning
When Simulink software detects a block priority specification error, it
displays a warning.
error
When Simulink software detects a block priority specification error, it
terminates the simulation and displays an error message.
Tips
Command-Line Information
Parameter: BlockPriorityViolationMsg
Type: string
Value: 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
1-194
Diagnostics Pane: Solver
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
• Controlling and Displaying the Sorted Order
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Diagnostics Pane: Solver
1-195
1 Configuration Parameters Dialog Box
Settings
Default: warning
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• A minimum step size violation can occur if the specified error tolerance for
the model requires a step size smaller than the specified minimum step
size. See Min step size and Maximum order for more information.
• Simulink software allows you to specify the maximum number of
consecutive minimum step size violations permitted (see Number of
consecutive min steps).
Command-Line Information
Parameter: MinStepSizeMsg
Type: string
Value: 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-196
Diagnostics Pane: Solver
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
1-197
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
Tips
• Simulink software might change a sample hit time if that hit time is
close to the hit time for another task. If Simulink software considers the
difference to be due only to numerical errors (for example, precision issues
or roundoff errors), it changes the sample hits of the faster task or tasks to
exactly match the time of the slowest task that has that hit.
• Over time, these sample hit changes might cause a discrepancy between
the numerical simulation results and the actual theoretical results.
• When this option is set to warning, the MATLAB Command Window
displays a warning like the following when Simulink software detects a
change in the sample hit time:
Warning: Timing engine warning: Changing the hit time for ...
Command-Line Information
Parameter: TimeAdjustmentMsg
Type: string
Value: 'none' | 'warning'
Default: 'none'
1-198
Diagnostics Pane: Solver
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-199
1 Configuration Parameters Dialog Box
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Dependency
This diagnostic applies only when you are using a variable-step solver and the
zero-crossing control is set to either Enable all or Use local settings.
Command-Line Information
Parameter: MaxConsecutiveZCsMsg
Type: string
Value: 'none' | 'warning'
Default: 'error'
1-200
Diagnostics Pane: Solver
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution warning or error
See Also
• Zero-Crossing Detection
• Zero-Crossing Control
• Number of consecutive zero crossings
• Time tolerance
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Diagnostics Pane: Solver
1-201
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: UnknownTsInhSupMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
1-202
Diagnostics Pane: Solver
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-203
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
1-204
Diagnostics Pane: Solver
Command-Line Information
Parameter: ConsistencyChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging warning
Traceability No impact
Efficiency none
Safety precaution No impact
See Also
1-205
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
When enabled, this option notifies you if:
Command-Line Information
Parameter: SolverPrmCheckMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
1-206
Diagnostics Pane: Solver
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-207
1 Configuration Parameters Dialog Box
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This error can occur if a discrete signal passes through a Model block to
the input of a block with continuous states, such as an Integrator block. In
this case, Simulink software cannot determine with certainty the minimum
rate at which it needs to reset the solver to solve this model accurately.
• If this diagnostic is set to none or warning, Simulink software resets the
solver whenever the value of the discrete signal changes. This ensures
accurate simulation of the model if the discrete signal is the source of the
signal entering the block with continuous states. However, if the discrete
signal is not the source of the signal entering the block with continuous
states, resetting the solver at the rate the discrete signal changes can lead
to the solver being reset more frequently than necessary, slowing down
the simulation.
• If this diagnostic is set to error, Simulink software halts when compiling
this model and displays an error.
Dependency
This diagnostic applies only when you are using a variable-step ode solver and
the block diagram contains Model blocks.
1-208
Diagnostics Pane: Solver
Command-Line Information
Parameter: ModelReferenceExtraNoncontSigs
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-209
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
Tips
Command-Line Information
Parameter: StateNameClashWarn
Type: string
Value: 'none' | 'warning'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-210
Diagnostics Pane: Solver
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
Settings
Default: warning
none
Simulink software does not compare the interface checksum to the
model checksum.
warning
The interface checksum in the SimState is different than the model
checksum.
error
When Simulink detects that a change in the configuration settings
occurred after saving the SimState, it does not load the SimState and
reports an error.
1-211
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: SimStateInterfaceChecksum
Type: string
Value: 'warning' | 'error' | 'none'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-212
Diagnostics Pane: Sample Time
In this section...
“Sample Time Diagnostics Overview” on page 1-214
“Source block specifies -1 sample time” on page 1-215
“Discrete used as continuous” on page 1-217
“Multitask rate transition” on page 1-219
“Single task rate transition” on page 1-221
“Multitask conditionally executed subsystem” on page 1-223
“Tasks with equal priority” on page 1-225
“Enforce sample times specified by Signal Specification blocks” on page
1-227
1-213
1 Configuration Parameters Dialog Box
Configuration
Set the parameters displayed.
Tips
See Also
1-214
Diagnostics Pane: Sample Time
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• The Random Source block does not obey this parameter. If its Sample
time parameter is set to -1, the Random Source block inherits its sample
time from its output port and never produces warnings or errors.
• Some Communications Blockset™ blocks internally inherit sample times,
which can be a useful and valid modeling technique. Set this parameter
to none for these types of models.
Command-Line Information
Parameter: InheritedTsInSrcMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
1-215
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-216
Diagnostics Pane: Sample Time
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: DiscreteInheritContinuousMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-217
1 Configuration Parameters Dialog Box
1-218
Diagnostics Pane: Sample Time
Settings
Default: error
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This parameter allows you to adjust error checking for sample rate
transitions between blocks that operate at different sample rates.
• Use this option for models of real-time multitasking systems to ensure
detection of illegal rate transitions between tasks that can result in a
task’s output being unavailable when needed by another task. You can
then use Rate Transition blocks to eliminate such illegal rate transitions
from the model.
Command-Line Information
Parameter: MultiTaskRateTransMsg
Type: string
Value: 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-219
1 Configuration Parameters Dialog Box
Application Setting
Efficiency No impact
Safety precaution error
See Also
1-220
Diagnostics Pane: Sample Time
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This parameter allows you to adjust error checking for sample rate
transitions between blocks that operate at different sample rates.
• Use this parameter when you are modeling a single-tasking system. In
such systems, task synchronization is not an issue.
Command-Line Information
Parameter: SingleTaskRateTransMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-221
1 Configuration Parameters Dialog Box
Application Setting
Efficiency No impact
Safety precaution none or error
See Also
1-222
Diagnostics Pane: Sample Time
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
1-223
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: MultiTaskCondExecSysMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-224
Diagnostics Pane: Sample Time
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This condition can occur when one asynchronous task of the target
represented by this model has the same priority as one of the target’s
asynchronous tasks.
• This option must be set to Error if the target allows tasks having the same
priority to preempt each other.
Command-Line Information
Parameter: TasksWithSamePriorityMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
1-225
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution none or error
See Also
1-226
Diagnostics Pane: Sample Time
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• The Signal Specification block allows you to specify the attributes of the
signal connected to its input and output ports. If the specified attributes
conflict with the attributes specified by the blocks connected to its ports,
Simulink software displays an error when it compiles the model, for
example, at the beginning of a simulation. If no conflict exists, Simulink
software eliminates the Signal Specification block from the compiled model.
• You can use the Signal Specification block to ensure that the actual
attributes of a signal meet desired attributes, or to ensure correct
propagation of signal attributes throughout a model.
Command-Line Information
Parameter: SigSpecEnsureSampleTimeMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
1-227
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-228
Diagnostics Pane: Data Validity
1-229
1 Configuration Parameters Dialog Box
In this section...
“Data Validity Diagnostics Overview” on page 1-231
“Signal resolution” on page 1-232
“Division by singular matrix” on page 1-234
“Underspecified data types” on page 1-236
“Simulation range checking” on page 1-238
“Detect overflow” on page 1-240
“Inf or NaN block output” on page 1-242
“"rt" prefix for identifiers” on page 1-244
“Detect downcast” on page 1-246
“Detect overflow” on page 1-248
“Detect underflow” on page 1-250
“Detect precision loss” on page 1-252
“Detect loss of tunability” on page 1-254
“Detect read before write” on page 1-256
“Detect write after read” on page 1-258
“Detect write after write” on page 1-260
“Multitask data store” on page 1-262
“Duplicate data store names” on page 1-264
“Detect multiple driving blocks executing at the same time step” on page
1-266
“Underspecified initialization detection” on page 1-268
“Check undefined subsystem initial output” on page 1-271
“Check preactivation output of execution context” on page 1-274
“Check runtime output of execution context” on page 1-277
“Array bounds exceeded” on page 1-280
“Model Verification block enabling” on page 1-282
1-230
Diagnostics Pane: Data Validity
Configuration
Set the parameters displayed.
Tips
See Also
1-231
1 Configuration Parameters Dialog Box
Signal resolution
Select how Simulink software resolves signals to Simulink.Signal objects.
See “Explicit and Implicit Symbol Resolution” for more information.
Settings
Default: Explicit only
Explicit only
Do not perform implicit signal resolution. Only explicitly specified
signal resolution occurs. This is the recommended setting.
Explicit and implicit
Perform implicit signal resolution wherever possible, without posting
any warnings about the implicit resolutions.
Explicit and warn implicit
Perform implicit signal resolution wherever possible, posting a warning
of each implicit resolution that occurs.
Tips
• Use the Signal Properties dialog box (see Signal Properties Dialog Box) to
specify explicit resolution for signals.
• Use the State Attributes pane on dialog boxes of blocks that have discrete
states, e.g., the Discrete-Time Integrator block, to specify explicit resolution
for discrete states.
• Multiple signals can resolve to the same signal object and have the
properties that the object specifies.
• The MathWorks discourages using implicit signal resolution except for fast
prototyping, because implicit resolution slows performance, complicates
model validation, and can have nondeterministic effects.
• Simulink software provides the disableimplicitsignalresolution
function, which you can use to change settings throughout a model so that
it does not use implicit signal resolution.
1-232
Diagnostics Pane: Data Validity
Command-Line Information
Parameter: SignalResolutionControl
Type: string
Value: 'UseLocalSettings' | 'TryResolveAll' |
'TryResolveAllWithWarning'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Explicit only
See Also
1-233
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: CheckMatrixSingularityMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-234
Diagnostics Pane: Data Validity
• Product block
• Configuration Parameters Dialog Box
• Diagnostics Pane: Data Validity
1-235
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: UnderSpecifiedDataTypeMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-236
Diagnostics Pane: Data Validity
1-237
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: SignalRangeChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
1-238
Diagnostics Pane: Data Validity
Recommended Settings
Application Setting
Debugging warning or error
Traceability warning or error
Efficiency none
Safety precaution error
See Also
1-239
1 Configuration Parameters Dialog Box
Detect overflow
Select the diagnostic action to take if the value of a signal or parameter is too
large to be represented by the signal or parameter’s data type.
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This diagnostic applies only to overflows for integer and fixed-point data
types.
• To check for floating-point overflows (e.g., Inf or NaN) for double or single
data types, select the Inf or NaN block output diagnostic. (See “Inf or
NaN block output” on page 1-242 for more information.)
Command-Line Information
Parameter: IntegerOverflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
1-240
Diagnostics Pane: Data Validity
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-241
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: SignalInfNanChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-242
Diagnostics Pane: Data Validity
Application Setting
Efficiency No impact
Safety precaution error
See Also
1-243
1 Configuration Parameters Dialog Box
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: RTPrefix
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
1-244
Diagnostics Pane: Data Validity
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-245
1 Configuration Parameters Dialog Box
Detect downcast
Select the diagnostic action to take when a parameter downcast occurs during
simulation.
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: ParameterDowncastMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-246
Diagnostics Pane: Data Validity
Application Setting
Efficiency No impact
Safety precaution error
See Also
1-247
1 Configuration Parameters Dialog Box
Detect overflow
Select the diagnostic action to take if a parameter overflow occurs during
simulation.
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
1-248
Diagnostics Pane: Data Validity
Command-Line Information
Parameter: ParameterOverflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-249
1 Configuration Parameters Dialog Box
Detect underflow
Select the diagnostic action to take when a parameter underflow occurs
during simulation.
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: ParameterUnderflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
1-250
Diagnostics Pane: Data Validity
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-251
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
1-252
Diagnostics Pane: Data Validity
- Slope is the slope of the parameter data type (slope = 1 for integers).
- Videal is the full-precision, ideal value of the parameter.
Command-Line Information
Parameter: ParameterPrecisionLossMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-253
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tip
If a tunable workspace variable is modified by Mask Initialization code, or is
used in an arithmetic expression with unsupported operators or functions, the
expression is reduced to a numeric expression and therefore cannot be tuned.
Command-Line Information
Parameter: ParameterTunabilityLossMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
1-254
Diagnostics Pane: Data Validity
See Also
1-255
1 Configuration Parameters Dialog Box
Settings
Default: Use local settings
Command-Line Information
Parameter: ReadBeforeWriteMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' |
'EnableAllAsError'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Enable all as errors
1-256
Diagnostics Pane: Data Validity
See Also
• Diagnosing Simulation Errors
• Working with Data Stores
• Data Store Memory block
• Simulink.Signal object
• Configuration Parameters Dialog Box
• Diagnostics Pane: Data Validity
1-257
1 Configuration Parameters Dialog Box
Settings
Default: Use local settings
Command-Line Information
Parameter: WriteAfterReadMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' |
'EnableAllAsError'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Enable all as errors
1-258
Diagnostics Pane: Data Validity
See Also
• Diagnosing Simulation Errors
• Working with Data Stores
• Data Store Memory block
• Simulink.Signal object
• Configuration Parameters Dialog Box
• Diagnostics Pane: Data Validity
1-259
1 Configuration Parameters Dialog Box
Settings
Default: Use local settings
Command-Line Information
Parameter: WriteAfterWriteMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' |
'EnableAllAsError'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Enable all as errors
1-260
Diagnostics Pane: Data Validity
See Also
• Diagnosing Simulation Errors
• Working with Data Stores
• Data Store Memory block
• Simulink.Signal object
• Configuration Parameters Dialog Box
• Diagnostics Pane: Data Validity
1-261
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• Such a situation is safe only if one of the tasks cannot interrupt the other,
such as when the data store is a scalar and the writing task uses an atomic
copy operation to update the store or the target does not allow the tasks to
preempt each other.
• You should disable this diagnostic (set it to none) only if the application
warrants it, such as if the application uses a cyclic scheduler that prevents
tasks from preempting each other.
Command-Line Information
Parameter: MultiTaskDSMMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
1-262
Diagnostics Pane: Data Validity
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-263
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tip
This diagnostic is useful for detecting errors that can occur when a lower-level
data store unexpectedly shadows a higher-level data store that has the same
name.
Command-Line Information
Parameter: UniqueDataStoreMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-264
Diagnostics Pane: Data Validity
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
1-265
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Dependency
This parameter is enabled only if Underspecified initialization detection
is set to Classic.
1-266
Diagnostics Pane: Data Validity
Command-Line Information
Parameter: MergeDetectMultiDrivingBlocksExec
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging error
Traceability error
Efficiency No impact
Safety precaution error
See Also
1-267
1 Configuration Parameters Dialog Box
Settings
Default: Classic
Classic
Initial conditions are initialized the same way they were prior to R2008b.
Simplified
Initial conditions are initialized using the enhanced behavior, which can
improve the consistency of simulation results.
Tips
1-268
Diagnostics Pane: Data Validity
Dependencies
Selecting Classic enables the following parameters:
Command-Line Information
Parameter: UnderspecifiedInitializationDetection
Type: string
Value: 'classic' | 'simplified'
Default: 'classic'
Recommended Settings
Application Setting
Debugging Simplified
Traceability Simplified
Efficiency Simplified
Safety precaution Simplified
See Also
1-269
1 Configuration Parameters Dialog Box
1-270
Diagnostics Pane: Data Validity
Settings
Default: On
On
Displays a warning if the model contains a conditionally executed
subsystem in which a block with a specified initial condition drives an
Outport block with an undefined initial condition.
Off
Does not display a warning.
Tips
• This situation occurs when a block with a specified initial condition, such
as a Constant, Initial Condition, or Delay block, drives an Outport block
with an undefined initial condition (Initial output parameter is set to []).
• Models with such subsystems can produce initial results (i.e., before initial
activation of the conditionally executed subsystem) in the current release
that differ from initial results produced in Release 13 or earlier releases.
Consider for example the following model.
1-271
1 Configuration Parameters Dialog Box
This model does not define the initial condition of the triggered subsystem’s
output port.
The following figure compares the superimposed output of this model’s Step
block and the triggered subsystem in Release 13 and the current release.
Notice that the initial output of the triggered subsystem differs between
the two releases. This is because Release 13 and earlier releases use the
initial output of the block connected to the output port (i.e., the Constant
block) as the triggered subsystem’s initial output. By contrast, this release
outputs 0 as the initial output of the triggered subsystem because the
model does not specify the port’s initial output.
Dependency
This parameter is enabled only if Underspecified initialization detection
is set to Classic.
Command-Line Information
Parameter: CheckSSInitialOutputMsg
Type: string
Value: 'on' | 'off'
Default: 'on'
1-272
Diagnostics Pane: Data Validity
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution On
See Also
1-273
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Displays a warning if Simulink software detects potential initial output
differences from previous releases.
Off
Does not display a warning.
Tips
• This diagnostic is triggered if the model contains a block that meets the
following conditions:
- The block produces nonzero output for zero input (e.g., a Cosine block).
- The block is connected to an output of a conditionally executed
subsystem.
- The block inherits its execution context from that subsystem.
- The Outport to which it is connected has an undefined initial condition,
i.e., the Outport block’s Initial output parameter is set to [].
• Models with blocks that meet these criteria can produce initial results
(i.e., before the conditionally executed subsystem is first activated in the
current release that differ from initial results produced in Release 13 or
earlier releases.
Consider for example the following model.
1-274
Diagnostics Pane: Data Validity
Note that the initial output of the cos block differs between the two
releases. This is because in Release 13, the cos block belongs to the
execution context of the root system and hence executes at every time step
whereas in the current release, the cos block belongs to the execution
context of the triggered subsystem and hence executes only when the
triggered subsystem executes.
1-275
1 Configuration Parameters Dialog Box
Dependency
This parameter is enabled only if Underspecified initialization detection
is set to Classic.
Command-Line Information
Parameter: CheckExecutionContextPreStartOutputMsg
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution On
See Also
1-276
Diagnostics Pane: Data Validity
Settings
Default: Off
On
Displays a warning if Simulink software detects potential output
differences from previous releases.
Off
Does not display a warning.
Tips
• This diagnostic is triggered if the model contains a block that meets the
following conditions:
- The block has a tunable parameter.
- The block is connected to an output of a conditionally executed
subsystem.
- The block inherits its execution context from that subsystem.
- The Outport to which it is connected has an undefined initial condition,
i.e., the Outport block’s Initial output parameter is set to [].
• Models with blocks that meet these criteria can produce results when the
parameter is tuned in the current release that differ from results produced
in Release 13 or earlier releases.
Consider for example the following model.
1-277
1 Configuration Parameters Dialog Box
In this model, the tunevar S-function changes the value of the Gain
block’s k parameter and updates the diagram at simulation time 7 (i.e., it
simulates tuning the parameter).
The following figure compares the superimposed output of the model’s Pulse
Generator block and its Gain block in Release 13 and the current release.
Note that the output of the Gain block changes at time 7 in Release 13
but does not change in the current release. This is because in Release 13,
the Gain block belongs to the execution context of the root system and
hence executes at every time step whereas in the current release, the Gain
1-278
Diagnostics Pane: Data Validity
block belongs to the execution context of the triggered subsystem and hence
executes only when the triggered subsystem executes, i.e., at times 5, 10,
15, and 20.
Dependency
This parameter is enabled only if Underspecified initialization detection
is set to Classic.
Command-Line Information
Parameter: CheckExecutionContextRuntimeOutputMsg
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution On
See Also
1-279
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: ArrayBoundsChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
1-280
Diagnostics Pane: Data Validity
Recommended Settings
Application Setting
Debugging warning
Traceability No impact
Efficiency none
Safety precaution No impact
See Also
1-281
1 Configuration Parameters Dialog Box
Settings
Default: Use local settings
Dependency
Simulation and code generation ignore the Model Verification block
enabling parameter when model verification blocks are inside a S-function.
Command-Line Information
Parameter: AssertControl
Type: string
Value: 'UseLocalSettings' | 'EnableAll' | 'DisableAll'
Default: 'UseLocalSettings'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-282
Diagnostics Pane: Data Validity
Application Setting
Efficiency No impact
Safety precaution Disable all
See Also
1-283
1 Configuration Parameters Dialog Box
In this section...
“Type Conversion Diagnostics Overview” on page 1-285
“Unnecessary type conversions” on page 1-286
“Vector/matrix block input conversion” on page 1-287
“32-bit integer to single precision float conversion” on page 1-289
“Detect underflow” on page 1-291
“Detect precision loss” on page 1-293
“Detect overflow” on page 1-295
1-284
Diagnostics Pane: Type Conversion
Configuration
Set the parameters displayed.
Tips
See Also
• Diagnosing Simulation Errors
• Solver Diagnostics
• Sample Time Diagnostics
• Data Validity Diagnostics
• Connectivity Diagnostics
• Compatibility Diagnostics
• Model Referencing Diagnostics
• Saving Diagnostics
• Configuration Parameters Dialog Box
• Diagnostics Pane: Type Conversion
1-285
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
Command-Line Information
Parameter: UnnecessaryDatatypeConvMsg
Type: string
Value: 'none' | 'warning'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution warning
See Also
1-286
Diagnostics Pane: Type Conversion
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Simulink software converts vectors to row or column matrices and row or
column matrices to vectors under the following circumstances:
Command-Line Information
Parameter: VectorMatrixConversionMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
1-287
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-288
Diagnostics Pane: Type Conversion
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
Tip
Converting a 32-bit integer value to a floating-point value can result in a loss
of precision. See Working with Data Types for more information.
Command-Line Information
Parameter: Int32ToFloatConvMsg
Type: string
Value: 'none' | 'warning'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution warning
See Also
1-289
1 Configuration Parameters Dialog Box
1-290
Diagnostics Pane: Type Conversion
Detect underflow
Specifies diagnostic action to take when a fixed-point constant underflow
occurs during simulation.
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This diagnostic applies only to fixed-point constants (net slope and net bias).
• Fixed-point constant underflow occurs when Simulink software encounters
a fixed-point constant whose data type does not have enough precision to
represent the ideal value of the constant because the ideal value is too
small.
• When fixed-point constant underflow occurs, casting the ideal value to the
data type causes the value of the fixed-point constant to become zero, and
therefore to differ from its ideal value.
Dependency
This parameter requires a Simulink Fixed Point license.
Command-Line Information
Parameter:FixptConstUnderflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
1-291
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-292
Diagnostics Pane: Type Conversion
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This diagnostic applies only to fixed-point constants (net slope and net bias).
• Precision loss occurs when Simulink software converts a fixed-point
constant to a data type which does not have enough precision to represent
the exact value of the constant. As a result, the quantized value differs
from the ideal value.
• Fixed-point constant precision loss differs from fixed-point constant
overflow. Overflow occurs when the range of the parameter’s data type,
that is, the maximum value that it can represent, is smaller than the ideal
value of the parameter.
Dependency
This parameter requires a Simulink Fixed Point license.
Command-Line Information
Parameter:FixptConstPrecisionLossMsg
Type: string
Value: 'none' | 'warning' | 'error'
1-293
1 Configuration Parameters Dialog Box
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-294
Diagnostics Pane: Type Conversion
Detect overflow
Specifies diagnostic action to take when a fixed-point constant overflow occurs
during simulation.
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• This diagnostic applies only to fixed-point constants (net slope and net bias).
• Overflow occurs when the Simulink software converts a fixed-point
constant to a data type whose range is not large enough to accommodate
the ideal value of the constant. The ideal value is either too large or too
small to be represented by the data type. For example, suppose that the
ideal value is 200 and the converted data type is int8. Overflow occurs in
this case because the maximum value that int8 can represent is 127.
• Fixed-point constant overflow differs from fixed-point constant precision
loss. Precision loss occurs when the ideal fixed-point constant value is
within the range of the data type and scaling being used, but cannot be
represented exactly.
Dependency
This parameter requires a Simulink Fixed Point license.
Command-Line Information
Parameter:FixptConstOverflowMsg
1-295
1 Configuration Parameters Dialog Box
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-296
Diagnostics Pane: Connectivity
In this section...
“Connectivity Diagnostics Overview” on page 1-299
“Signal label mismatch” on page 1-300
“Unconnected block input ports” on page 1-302
“Unconnected block output ports” on page 1-304
“Unconnected line” on page 1-306
“Unspecified bus object at root Outport block” on page 1-308
“Element name mismatch” on page 1-310
“Mux blocks used to create bus signals” on page 1-312
“Bus signal treated as vector” on page 1-315
1-297
1 Configuration Parameters Dialog Box
In this section...
“Invalid function-call connection” on page 1-318
“Context-dependent inputs” on page 1-320
1-298
Diagnostics Pane: Connectivity
Configuration
Set the parameters displayed.
Tips
See Also
• Diagnosing Simulation Errors
• Solver Diagnostics
• Sample Time Diagnostics
• Data Validity Diagnostics
• Type Conversion Diagnostics
• Compatibility Diagnostics
• Model Referencing Diagnostics
• Saving Diagnostics
• Configuration Parameters Dialog Box
• Diagnostics Pane: Connectivity
1-299
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: SignalLabelMismatchMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-300
Diagnostics Pane: Connectivity
• Virtual Signals
• Configuration Parameters Dialog Box
• Diagnostics Pane: Connectivity
1-301
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: UnconnectedInputMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-302
Diagnostics Pane: Connectivity
1-303
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: UnconnectedOutputMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-304
Diagnostics Pane: Connectivity
1-305
1 Configuration Parameters Dialog Box
Unconnected line
Select the diagnostic action to take when the Model contains an unconnected
line or an unmatched Goto or From block.
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: UnconnectedLineMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-306
Diagnostics Pane: Connectivity
• Goto block
• From block
• Configuration Parameters Dialog Box
• Diagnostics Pane: Connectivity
1-307
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: RootOutportRequireBusObject
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-308
Diagnostics Pane: Connectivity
• Outport block
• Simulink.Bus
• Configuration Parameters Dialog Box
• Diagnostics Pane: Connectivity
1-309
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tip
You can use this diagnostic along with bus objects to ensure that your model
meets bus element naming requirements imposed by some blocks, such as
the Switch block.
Command-Line Information
Parameter: BusObjectLabelMismatch
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
1-310
Diagnostics Pane: Connectivity
See Also
1-311
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
This option disables checking for Mux blocks used to create virtual bus
signals.
warning
Simulink software displays a warning.
This option does not enforce strict bus behavior. However, if it detects a
Mux block that creates a virtual bus during model update or simulation,
it displays a message in the MATLAB Command Window that identifies
the offending block. It does this for the first ten Mux blocks that it
encounters that violate strict bus behavior.
error
Simulink software terminates the simulation and displays an error
message identifying the first Mux block it encounters that is used to
create a virtual bus. If this option is selected, a Mux block with more
than one input is allowed to output only a vector signal, and a Mux
block with only one input is allowed to output only a scalar, vector,
or matrix signal.
Tips
• This diagnostic detects use of Mux blocks to create virtual buses. The
diagnostic considers a signal created by a Mux block to be a virtual bus if
the signal meets either or both of the following conditions:
- A Bus Selector block individually selects one or more of the signal’s
elements (as opposed to the entire signal).
1-312
Diagnostics Pane: Connectivity
Dependency
Selecting error enables the following parameter:
Command-Line Information
Parameter: StrictBusMsg
Type: string
Value: 'none' | 'warning' | 'ErrorLevel1' |
'WarnOnBusInputToNonBusBlock' | 'ErrorOnBusInputToNonBusBlock'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-313
1 Configuration Parameters Dialog Box
Application Setting
Efficiency No impact
Safety precaution error
See Also
1-314
Diagnostics Pane: Connectivity
Settings
Default: warning
none
Disables checking for virtual buses used as muxes.
warning
Simulink software displays a warning if it detects a virtual bus used as
a mux. This option does not enforce strict bus behavior.
error
Simulink software terminates the simulation and displays an error
message when it builds a model that uses any virtual bus as a mux.
Tips
• This diagnostic detects the use of virtual bus signals used to specify muxes.
The diagnostic considers a virtual bus signal to be used as a mux if it is
input to a Demux block or to any block that can input a mux or a vector but
is not formally defined as bus-capable. See Bus-Capable Blocks for details.
• Virtual buses can be used as muxes only when they contain no nested
buses and all constituent signals have the same attributes. This practice
is deprecated as of R2007a (V6.6) and may cease to be supported at some
future time. The MathWorks therefore discourages mixing virtual buses
with muxes in new applications, and encourages upgrading existing
applications to avoid such mixtures.
• If you are using simplified initialization mode, you must set this diagnostic
to error. For more information, see Underspecified initialization detection.
• You can identify bus signals that are treated as a vectors using the Model
Advisor check Check for proper bus usage. For more information, see
“Check for proper bus usage”.
• You can eliminate warnings and errors about virtual buses used as muxes
by using Simulink.BlockDiagram.addBusToVector to insert a Bus to
1-315
1 Configuration Parameters Dialog Box
Vector block into any virtual bus signal that is used as a mux. Before
executing the command, you should set this diagnostic to warning or none.
• See Avoiding Mux/Bus Mixtures for more information.
Dependency
This parameter is enabled only when Mux blocks used to create bus
signals is set to error.
Command-Line Information
Parameter: StrictBusMsg
Type: string
Value: 'none' | 'warning' | 'ErrorLevel1' |
'WarnOnBusTreatedAsVector' | 'ErrorOnBusTreatedAsVector'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-316
Diagnostics Pane: Connectivity
1-317
1 Configuration Parameters Dialog Box
Settings
Default: error
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
Command-Line Information
Parameter: InvalidFcnCallConnMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
1-318
Diagnostics Pane: Connectivity
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-319
1 Configuration Parameters Dialog Box
Context-dependent inputs
Select the diagnostic action to take when Simulink software has to compute
any of a function-call subsystem’s inputs directly or indirectly during
execution of a call to a function-call subsystem.
Settings
Default: Use local settings
Tips
Command-Line Information
Parameter: FcnCallInpInsideContextMsg
Type: string
Value: 'Use local settings' | 'Enable All' | 'Disable All'
Default: 'Use local settings'
Recommended Settings
Application Setting
Debugging No impact
1-320
Diagnostics Pane: Connectivity
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution Enable all
See Also
1-321
1 Configuration Parameters Dialog Box
In this section...
“Compatibility Diagnostics Overview” on page 1-323
“S-function upgrades needed” on page 1-324
1-322
Diagnostics Pane: Compatibility
Configuration
Set the parameters displayed.
Tips
See Also
• Diagnosing Simulation Errors
• Solver Diagnostics
• Sample Time Diagnostics
• Data Validity Diagnostics
• Type Conversion Diagnostics
• Connectivity Diagnostics
• Compatibility Diagnostics
• Model Referencing Diagnostics
• Saving Diagnostics
• Configuration Parameters Dialog Box
• Diagnostics Pane: Compatibility
1-323
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Command-Line Information
Parameter: SfunCompatibilityCheckMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
1-324
Diagnostics Pane: Compatibility
1-325
1 Configuration Parameters Dialog Box
In this section...
“Model Referencing Diagnostics Overview” on page 1-327
“Model block version mismatch” on page 1-328
“Port and parameter mismatch” on page 1-330
“Model configuration mismatch” on page 1-332
“Invalid root Inport/Outport block connection” on page 1-334
“Unsupported data logging” on page 1-338
1-326
Diagnostics Pane: Model Referencing
Configuration
Set the parameters displayed.
Tips
See Also
• Referencing Models
• Diagnosing Simulation Errors
• Solver Diagnostics
• Sample Time Diagnostics
• Data Validity Diagnostics
• Type Conversion Diagnostics
• Connectivity Diagnostics
• Compatibility Diagnostics
• Saving Diagnostics
• Configuration Parameters Dialog Box
• Diagnostics Pane: Model Referencing
1-327
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning and refreshes the Model block.
error
Simulink software displays an error message and does not refresh
Model block.
Tip
If you have enabled display of referenced model version numbers on Model
blocks for this model (see Displaying Referenced Model Version Numbers),
Simulink software displays a version mismatch on the Model block icon, for
example: Rev:1.0 != 1.2.
Command-Line Information
Parameter: ModelReferenceVersionMismatchMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-328
Diagnostics Pane: Model Referencing
Application Setting
Efficiency No impact
Safety precaution none
See Also
• Referencing Models
• Diagnosing Simulation Errors
• Displaying Referenced Model Version Numbers
• Configuration Parameters Dialog Box
• Diagnostics Pane: Model Referencing
1-329
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning and refreshes the Model block.
error
Simulink software displays an error message and does not refresh the
Model block.
Tips
• Port mismatches occur when there is a mismatch between the I/O ports of a
Model block and the root-level I/O ports of the model it references.
• Parameter mismatches occur when there is a mismatch between the
parameter arguments recognized by the Model block and the parameter
arguments declared by the referenced model.
• Model block icons can display a message indicating port or parameter
mismatches. To enable this feature, select Block displays > Model Block
I/O Mismatch from the parent model’s Format menu.
Command-Line Information
Parameter: ModelReferenceIOMismatchMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
1-330
Diagnostics Pane: Model Referencing
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
• Referencing Models
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Diagnostics Pane: Model Referencing
1-331
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tip
Set this diagnostic to warning or error if you suspect that an inappropriate
or mismatched configuration parameter may be causing your model to give
the wrong result.
Command-Line Information
Parameter: ModelReferenceCSMismatchMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-332
Diagnostics Pane: Model Referencing
Application Setting
Efficiency No impact
Safety precaution warning
See Also
• Referencing Models
• Configuration Parameter Requirements
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Diagnostics Pane: Model Referencing
1-333
1 Configuration Parameters Dialog Box
Settings
Default: none
none
Simulink software silently inserts hidden blocks to satisfy the
constraints wherever possible.
warning
Simulink software warns you that a connection constraint has been
violated and attempts to satisfy the constraint by inserting hidden
blocks.
error
Simulink software terminates the simulation or code generation and
displays an error message.
Tips
1-334
Diagnostics Pane: Model Referencing
- Two root Outport blocks are connected to the same block port:
1-335
1 Configuration Parameters Dialog Box
Command-Line Information
Parameter: ModelReferenceIOMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution error
See Also
• Referencing Models
1-336
Diagnostics Pane: Model Referencing
1-337
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning.
error
Simulink software terminates the simulation and displays an error
message.
Tips
• The default action warns you that Simulink software does not support use
of these blocks to log data from referenced models.
• See Logging Referenced Model Signals for information on how to log signals
from a reference to this model.
Command-Line Information
Parameter: ModelReferenceDataLoggingMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-338
Diagnostics Pane: Model Referencing
Application Setting
Efficiency No impact
Safety precaution error
See Also
• Referencing Models
• Diagnosing Simulation Errors
• Logging Referenced Model Signals
• To Workspace block
• Scope block
• Configuration Parameters Dialog Box
• Diagnostics Pane: Model Referencing
1-339
1 Configuration Parameters Dialog Box
In this section...
“Saving Tab Overview” on page 1-341
“Block diagram contains disabled library links” on page 1-342
“Block diagram contains parameterized library links” on page 1-344
1-340
Diagnostics Pane: Saving
Configuration
Set the parameters displayed.
Tips
See Also
• Saving a Model
• Model Parameters
• Diagnosing Simulation Errors
• Solver Diagnostics
• Sample Time Diagnostics
• Data Validity Diagnostics
• Type Conversion Diagnostics
• Connectivity Diagnostics
• Compatibility Diagnostics
• Model Referencing Diagnostics
• Configuration Parameters Dialog Box
• Diagnostics Pane: Saving
1-341
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning and saves the block diagram. The
diagram may not contain the information you had intended.
error
Simulink software displays an error message. The model is not saved.
Tip
Use the Model Advisor Identify disabled library links check to find
disabled library links.
Command-Line Information
Parameter: SaveWithDisabledLinksMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-342
Diagnostics Pane: Saving
See Also
1-343
1 Configuration Parameters Dialog Box
Settings
Default: warning
none
Simulink software takes no action.
warning
Simulink software displays a warning and saves the block diagram. The
diagram may not contain the in formation you had intended.
error
Simulink software displays an error message. The model is not saved.
Tips
Command-Line Information
Parameter: SaveWithParameterizedLinksMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-344
Diagnostics Pane: Saving
See Also
1-345
1 Configuration Parameters Dialog Box
In this section...
“Hardware Implementation Overview” on page 1-348
“Device vendor” on page 1-349
“Device type” on page 1-352
“Number of bits: char” on page 1-361
“Number of bits: short” on page 1-363
“Number of bits: int” on page 1-365
“Number of bits: long” on page 1-367
“Number of bits: native word size” on page 1-369
“Byte ordering” on page 1-371
“Signed integer division rounds to” on page 1-373
“Shift right on a signed integer as arithmetic shift” on page 1-376
“None” on page 1-378
“Device vendor” on page 1-380
1-346
Hardware Implementation Pane
In this section...
“Device type” on page 1-382
“Number of bits: char” on page 1-391
“Number of bits: short” on page 1-393
“Number of bits: int” on page 1-395
“Number of bits: long” on page 1-397
“Number of bits: native word size” on page 1-399
“Byte ordering” on page 1-401
“Signed integer division rounds to” on page 1-403
“Shift right on a signed integer as arithmetic shift” on page 1-406
1-347
1 Configuration Parameters Dialog Box
Configuration
Tips
See Also
1-348
Hardware Implementation Pane
Device vendor
Select the manufacturer of the hardware you will use to implement the
production version of the system represented by this model.
Settings
Default: Generic
• AMD
• ARM Compatible
• ASIC/FPGA
• Analog Devices
• Atmel
• Freescale
• Infineon
• Intel
• Microchip
• NEC
• Renesas
• SGI
• STMicroelectronics
• Texas Instruments
• Generic
Tips
• Select the device vendor before you specify the hardware device used to
define your system’s constraints.
• If your test hardware does not match any of the listed vendors, select
Generic.
1-349
1 Configuration Parameters Dialog Box
• The Device vendor and Device type fields both share the same command
line parameter: ProdHWDeviceType. When specifying this parameter from
the command line, separate the device vendor and device type values using
the characters >. For example: 'Intel->8051 Compatible'.
• To add Device vendor and Device type values to the default set that
is displayed on the Hardware Implementation pane, see “Registering
Additional Device Vendor and Device Type Values” in the Real-Time
Workshop documentation.
Dependencies
This parameter determines the options available in the Device type
drop-down menu.
Command-Line Information
Parameter: ProdHWDeviceType
Type: string
Value: any valid value (see tips)
Default: 'Generic->Unspecified (assume 32-bit Generic)'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-350
Hardware Implementation Pane
1-351
1 Configuration Parameters Dialog Box
Device type
Select the type of hardware you will use to implement the production version
of the system represented by this model.
Settings
Default: Unspecified (assume 32 bit Generic)
Generic options:
AMD® options:
• K5/K6/Athlon
• ARM 7
• ARM 8
• ARM 9
ASIC/FPGA options:
• ASIC/FPGA
• Blackfin
1-352
Hardware Implementation Pane
• SHARC
• TigerSHARC
Atmel® options:
• AVR
Freescale™ options:
• 32-bit PowerPC
• 68332
• 68HC08
• 68HC11
• ColdFire
• DSP563xx (16-bit mode)
• HC(S)12
• MPC5500
Infineon® options:
• C16x, XC16x
• TriCore
Intel® options:
• 8051 Compatible
• x86/Pentium
Microchip:
• PIC18
• dsPIC
NEC® options:
1-353
1 Configuration Parameters Dialog Box
• V850
Renesas® options:
• M16C
• M32C
• R8C/Tiny
• SH-2/3/4
SGI:
• UltraSPARC IIi
STMicroelectronics:
• ST10/Super10
• C2000
• C5000
• C6000
• MSP430
Tips
• Select the device vendor before you specify the hardware device type.
• Selecting a device type specifies the hardware device to define your
system’s constraints:
- Default hardware properties appear as the initial values.
- Parameters with only one possible value cannot be changed.
- Parameters with more than one possible value provide a pulldown list
of legal values.
- Static values for each device type are displayed in the following table.
1-354
Hardware Implementation Pane
1-355
1 Configuration Parameters Dialog Box
1-356
Hardware Implementation Pane
1-357
1 Configuration Parameters Dialog Box
• If your production hardware does not match any of the listed types, select
Unspecified (assume 32-bit Generic) if it has the characteristics of a
generic 32-bit microprocessor; otherwise select Custom.
• The Device vendor and Device type fields both share the same command
line parameter: ProdHWDeviceType. When specifying this parameter from
the command line, separate the device vendor and device type values using
the characters >. For example: 'Intel->8051 Compatible'.
• To add Device vendor and Device type values to the default set that
is displayed on the Hardware Implementation pane, see “Registering
Additional Device Vendor and Device Type Values” in the Real-Time
Workshop documentation.
1-358
Hardware Implementation Pane
Dependencies
The options available in the drop-down menu are determined by the Device
vendor parameter.
• char
• short
• int
• long
• native word size
• Byte ordering
• Signed integer division rounds to
• Shift right on a signed integer as arithmetic shift
Command-Line Information
Parameter: ProdHWDeviceType
Type: string
Value: any valid value (see tips)
Default: 'Generic->Unspecified (assume 32-bit Generic)'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-359
1 Configuration Parameters Dialog Box
See Also
1-360
Hardware Implementation Pane
Settings
Default: 8
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: ProdBitPerChar
Type: integer
Value: any valid value
Default: 8
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-361
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-362
Hardware Implementation Pane
Settings
Default: 16
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: ProdBitPerShort
Type: integer
Value: any valid value
Default: 16
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-363
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-364
Hardware Implementation Pane
Settings
Default: 32
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: ProdBitPerInt
Type: integer
Value: any valid value
Default: 32
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-365
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-366
Hardware Implementation Pane
Settings
Default: 32
Minimum: 32
Maximum: 64
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: ProdBitPerLong
Type: integer
Value: any valid value
Default: 32
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-367
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-368
Hardware Implementation Pane
Settings
Default: 32
Minimum: 8
Maximum: 64
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: ProdWordSize
Type: integer
Value: any valid value
Default: 32
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-369
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-370
Hardware Implementation Pane
Byte ordering
Describe the byte ordering for the production hardware.
Settings
Default: Unspecified
Unspecified
Specifies that the code determines the endianness of the hardware.
This is the least efficient choice.
Big Endian
The most significant byte appears first.
Little Endian
The least significant byte appears first.
Dependencies
Command-Line Information
Parameter: ProdEndianess
Type: string
Value: 'Unspecified' | 'LittleEndian' | 'BigEndian'
Default: 'Unspecified'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-371
1 Configuration Parameters Dialog Box
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
1-372
Hardware Implementation Pane
Settings
Default: Undefined
Undefined
Choose this option if neither Zero nor Floor describes the compiler’s
behavior, or if that behavior is unknown.
Zero
If the quotient is between two integers, the compiler chooses the integer
that is closer to zero as the result.
Floor
If the quotient is between two integers, the compiler chooses the integer
that is closer to negative infinity.
Tips
1-373
1 Configuration Parameters Dialog Box
Ideal
N D N/D Zero Floor Undefined
33 4 8.25 8 8 8
-33 4 -8.25 -8 -9 -8 or -9
33 -4 -8.25 -8 -9 -8 or -9
-33 -4 8.25 8 8 8 or 9
Dependency
This parameter is enabled by Device type.
Command-Line Information
Parameter: ProdIntDivRoundTo
Type: string
Value: 'Floor' | 'Zero' | 'Undefined'
Default: 'Undefined'
Recommended settings
Application Setting
Debugging No impact for simulation and during
development.
Undefined for production code generation.
Traceability No impact for simulation and during
development.
Zero or Floor for production code
generation.
Efficiency No impact for simulation and during
development.
Zero for production code generation.
Safety precaution No impact for simulation and during
development.
Floor for production code generation.
1-374
Hardware Implementation Pane
See Also
1-375
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Generates simple efficient code whenever the Simulink model performs
arithmetic shifts on signed integers.
Off
Generates fully portable but less efficient code to implement right
arithmetic shifts.
Tips
Dependency
This parameter is enabled by Device type.
Command-Line Information
Parameter: ProdShiftRightIntArith
Type: string
Value: 'on' | 'off'
Default: 'on'
1-376
Hardware Implementation Pane
Recommended settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
1-377
1 Configuration Parameters Dialog Box
None
Specify whether the test hardware differs from the deployment hardware.
Settings
Default: On
On
Specifies that the hardware used to test the code generated from
the model is the same as the production hardware, or has the same
characteristics.
Off
Specifies that the hardware used to test the code generated from the
model has different characteristics than the production hardware.
Tips
• You can generate code that runs on the test hardware but behaves as if it
had been generated for and executed on the deployment hardware.
• The Embedded hardware (simulation and code generation) subpane
specifies the deployment hardware properties. The Emulation hardware
(code generation only) subpane is used to specify the test hardware
properties.
Dependency
Enables the Emulation hardware subpane.
Command-Line Information
Parameter: ProdEqTarget
Type: string
Value: 'on' | 'off'
Default: 'on'
1-378
Hardware Implementation Pane
Recommended settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
More information
1-379
1 Configuration Parameters Dialog Box
Device vendor
Select the manufacturer of the hardware that will be used to test the code
generated from the model.
Settings
Default: Generic
• AMD
• ARM Compatible
• ASIC/FPGA
• Analog Devices
• Atmel
• Freescale
• Infineon
• Intel
• Microchip
• NEC
• Renesas
• SGI
• STMicroelectronics
• Texas Instruments
• Generic
Tips
• Select the device vendor before you specify the hardware device used to
define your system’s constraints.
• If your test hardware does not match any of the listed vendors, select
Generic.
1-380
Hardware Implementation Pane
• The Device vendor and Device type fields both share the same command
line parameter: TargetHWDeviceType. When specifying this parameter
from the command line, separate the device vendor and device type values
using the characters >. For example: 'Intel->8051 Compatible'.
Dependencies
This parameter determines the options available in the Device type
drop-down menu.
Command-Line Information
Parameter: TargetHWDeviceType
Type: string
Value: any valid value (see tips)
Default: 'Generic->Unspecified (assume 32-bit Generic)'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-381
1 Configuration Parameters Dialog Box
Device type
Select the type of hardware that will be used to test the code generated from
the model.
Settings
Default: Unspecified (assume 32 bit Generic)
Generic options:
AMD options:
• K5/K6/Athlon
• ARM 7
• ARM 8
• ARM 9
• Blackfin
• SHARC
• TigerSHARC
1-382
Hardware Implementation Pane
Atmel options:
• AVR
Freescale options:
• 32-bit PowerPC
• 68332
• 68HC08
• 68HC11
• ColdFire
• DSP563xx (16-bit mode)
• HC(S)12
• MPC5500
Infineon options:
• C16x, XC16x
• TriCore
Intel options:
• 8051 Compatible
• x86/Pentium
Microchip:
• PIC18
• dsPIC
NEC options:
• V850
Renesas options:
1-383
1 Configuration Parameters Dialog Box
• M16C
• R8C/Tiny
• SH-2/3/4
SGI:
• UltraSPARC IIi
STMicroelectronics:
• ST10/Super10
• C2000
• C5000
• C6000
• MSP430
Tips
• Select the device vendor before you specify the hardware device type.
• Selecting a device type specifies the hardware device to define your
system’s constraints:
- Default hardware properties appear as the initial values.
- Parameters with only one possible value cannot be changed.
- Parameters with more than one possible value provide a pulldown list
of legal values.
- Static values for each device type are displayed in the following table.
Parameters that you can modify are identified with an x.
1-384
Hardware Implementation Pane
1-385
1 Configuration Parameters Dialog Box
1-386
Hardware Implementation Pane
1-387
1 Configuration Parameters Dialog Box
• If your test hardware does not match any of the listed types, select
Unspecified (assume 32-bit Generic) if it has the characteristics of a
generic 32-bit microprocessor; otherwise select Custom.
• The Device vendor and Device type fields both share the same command
line parameter: TargetHWDeviceType. When specifying this parameter
from the command line, separate the device vendor and device type values
using the characters >. For example: 'Intel->8051 Compatible'.
Dependencies
The options available in the drop-down menu are determined by the Device
vendor parameter.
1-388
Hardware Implementation Pane
• char
• short
• int
• long
• native word size
• Byte ordering
• Signed integer division rounds to
• Shift right on a signed integer as arithmetic shift
Command-Line Information
Parameter: TargetHWDeviceType
Type: string
Value: any valid value (see tips)
Default: 'Generic->Unspecified (assume 32-bit Generic)'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-389
1 Configuration Parameters Dialog Box
1-390
Hardware Implementation Pane
Settings
Default: 8
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: TargetBitPerChar
Type: integer
Value: any valid value
Default: 8
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-391
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-392
Hardware Implementation Pane
Settings
Default: 16
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: TargetBitPerShort
Type: integer
Value: any valid value
Default: 16
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-393
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-394
Hardware Implementation Pane
Settings
Default: 32
Minimum: 8
Maximum: 32
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: TargetBitPerInt
Type: integer
Value: any valid value
Default: 32
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-395
1 Configuration Parameters Dialog Box
Application Setting
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-396
Hardware Implementation Pane
Settings
Default: 32
Minimum: 32
Maximum: 64
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: TargetBitPerLong
Type: integer
Value: any valid value
Default: 32
Recommended Settings
Application Setting
Debugging No impact
1-397
1 Configuration Parameters Dialog Box
Application Setting
Traceability No impact
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-398
Hardware Implementation Pane
Settings
Default: 32
Minimum: 8
Maximum: 64
Enter a value between 8 and 64. (The value 64 is selected by default if you run
MATLAB software on a 64-bit host computer and select the MATLAB host as
the test hardware — that is, TargetHWDeviceType equals 'Generic->MATLAB
Host Computer'.)
Tip
All values must be a multiple of 8.
Dependencies
Command-Line Information
Parameter: TargetWordSize
Type: integer
Value: any valid value
Default: 32
1-399
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency Target specific
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-400
Hardware Implementation Pane
Byte ordering
Describe the byte ordering for the hardware used to test code.
Settings
Default: Unspecified
Unspecified
Specifies that the code determines the endianness of the hardware.
This is the least efficient choice.
Big Endian
The most significant byte comes first.
Little Endian
The least significant byte comes first.
Dependencies
Command-Line Information
Parameter: TargetEndianess
Type: string
Value: 'Unspecified' | 'LittleEndian' | 'BigEndian'
Default: 'Unspecified'
1-401
1 Configuration Parameters Dialog Box
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact for simulation and during
development.
Match operation of compiler and hardware
for code generation.
See Also
1-402
Hardware Implementation Pane
Settings
Default: Undefined
Undefined
Choose this option if neither Zero nor Floor describes the compiler’s
behavior, or if that behavior is unknown.
Zero
If the quotient is between two integers, the compiler chooses the integer
that is closer to zero as the result.
Floor
If the quotient is between two integers, the compiler chooses the integer
that is closer to negative infinity.
Tips
1-403
1 Configuration Parameters Dialog Box
Ideal
N D N/D Zero Floor Undefined
33 4 8.25 8 8 8
-33 4 -8.25 -8 -9 -8 or -9
33 -4 -8.25 -8 -9 -8 or -9
-33 -4 8.25 8 8 8 or 9
Dependency
This parameter is enabled by Device type.
Command-Line Information
Parameter: TargetIntDivRoundTo
Type: string
Value: 'Floor' | 'Zero' | 'Undefined'
Default: 'Undefined'
Recommended settings
Application Setting
Debugging No impact for simulation and during
development.
Undefined for production code generation.
Traceability No impact for simulation and during
development.
Zero or Floor for production code
generation.
Efficiency No impact for simulation and during
development.
Zero for production code generation.
Safety precaution No impact for simulation and during
development.
Floor for production code generation.
1-404
Hardware Implementation Pane
See Also
1-405
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Generates simple efficient code whenever the Simulink model performs
arithmetic shifts on signed integers.
Off
Generates fully portable but less efficient code to implement right
arithmetic shifts.
Tips
Dependency
This parameter is enabled by Device type.
Command-Line Information
Parameter: TargetShiftRightIntArith
Type: string
Value: 'on' | 'off'
Default: 'on'
1-406
Hardware Implementation Pane
Recommended settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
See Also
1-407
1 Configuration Parameters Dialog Box
In this section...
“Model Referencing Pane Overview” on page 1-410
“Rebuild options” on page 1-411
“Never rebuild targets diagnostic” on page 1-414
“Total number of instances allowed per top model” on page 1-416
1-408
Model Referencing Pane
In this section...
“Model dependencies” on page 1-418
“Pass scalar root inputs by value for Real-Time Workshop” on page 1-420
“Minimize algebraic loop occurrences” on page 1-422
1-409
1 Configuration Parameters Dialog Box
Configuration
Set the parameters displayed.
Tips
See Also
• Model Dependencies
• Configuration Parameters Dialog Box
• Model Referencing Pane
1-410
Model Referencing Pane
Rebuild options
Select whether to rebuild simulation and Real-Time Workshop targets for
referenced models before updating, simulating, or generating code from this
model.
Settings
Default: If any changes detected
Tips
1-411
1 Configuration Parameters Dialog Box
Dependency
Selecting Never enables the Never rebuild targets diagnostic parameter.
Command-Line Information
Parameter: UpdateModelReferenceTargets
Type: string
Value: 'IfOutOfDate' | 'Force' | 'AssumeUpToDate' |
'IfOutOfDateOrStructuralChange'
Default: 'IfOutOfDateOrStructuralChange'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-412
Model Referencing Pane
Application Setting
Efficiency No impact
Safety precaution Never or If any changes detected
See Also
• Model Dependencies
• Configuration Parameters Dialog Box
• Model Referencing Pane
1-413
1 Configuration Parameters Dialog Box
Settings
Default: Error if targets require rebuild
none
Simulink software takes no action.
Warn if targets require rebuild
Simulink software displays a warning.
Error if targets require rebuild
Simulink software terminates the simulation and displays an error
message.
Tip
Selecting None bypasses dependency checking, and thus enables faster
updating, simulation, and code generation, but can cause models that are not
up-to-date to malfunction or generate incorrect results.
Dependency
This parameter is enabled only if you select Never in the Rebuild options
field.
Command-Line Information
Parameter: CheckModelReferenceTargetMessage
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'
Recommended Settings
Application Setting
Debugging No impact
1-414
Model Referencing Pane
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution error if targets require rebuild
See Also
1-415
1 Configuration Parameters Dialog Box
Settings
Default: Multiple
Zero
The model cannot be referenced. An error occurs if a reference to the
model occurs in another model.
One
The model can be referenced at most once in a model reference
hierarchy. An error occurs if more than one reference exists.
Multiple
The model can be referenced more than once in a hierarchy, provided
that it contains no constructs that preclude multiple reference. An
error occurs if the model cannot be multiply referenced, even if only
one reference exists.
Command-Line Information
Parameter: ModelReferenceNumInstancesAllowed
Type: string
Value: 'Zero' | 'Single' | 'Multi'
Default: 'Multi'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
1-416
Model Referencing Pane
See Also
1-417
1 Configuration Parameters Dialog Box
Model dependencies
Specify the files on which this model relies. They are typically MAT-files and
M-files used to initialize parameters and to provide data.
Settings
No Default
• Specify the dependencies as a cell array of strings, where each cell array
entry is the filename or path of a dependent file. These filenames may
include spaces and must include file extensions (e.g.,.m,.mat, etc.).
• Prefix the token $MDL to a dependency to indicate that the path to the
dependency is relative to the location of this model file.
• Wildcards are allowed. Use a ’%’ to comment out a line; use ’...’ to continue
lines.
Tips
Command-Line Information
Parameter: ModelDependencies
Type: string
Value: any valid value
Default: ''
Recommended Settings
Application Setting
Debugging No impact
1-418
Model Referencing Pane
Application Setting
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
• Model Dependencies
• Configuration Parameters Dialog Box
• Model Referencing Pane
1-419
1 Configuration Parameters Dialog Box
Settings
Default: Off (GUI), 'on' (command-line)
On
A model that calls (i.e., references) this model passes this model’s scalar
inputs by value.
Off
The calling model passes the inputs by reference (it passes the addresses
of the inputs rather than the input values).
Tips
• Passing roots by value allows this model to read its scalar inputs from
register or local memory which is faster than reading the inputs from their
original locations.
• However, passing roots by value can lead to incorrect results if the model’s
root scalar inputs can change within a time step. This can happen, for
instance, if this model’s inputs and outputs share memory locations (as a
result of a feedback loop) and the model is invoked multiple times in a time
step (i.e., by a Function-Call Subsystem). In such cases, this model sees
scalar input changes that occur in the same time step only if the inputs are
passed by reference. That is why this option is off by default.
• If you are certain that this model is not referenced in contexts where its
inputs can change within a time step, select this option to generate more
efficient code for this model.
• Selecting this option can affect reuse of code generated for subsystems. See
Reusable Code and Referenced Models for more information.
1-420
Model Referencing Pane
Command-Line Information
Parameter:ModelReferencePassRootInputsByReference
Type: string
Value: 'on' | 'off'
Default: 'on'
Note The command-line values are reverse of the settings values. Therefore,
'on' in the command line corresponds to the description of “Off” in the
settings section, and 'off' in the command line corresponds to the description
of “On” in the settings section.
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution Off
See Also
• Function-Call Subsystem
• Reusable Code and Referenced Models
• Configuration Parameters Dialog Box
• Model Referencing Pane
1-421
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Simulink software tries to eliminate algebraic loops involving this model
from models that reference it.
Off
Simulink software does not try to eliminate algebraic loops from the
models that reference this model.
Tips
Command-Line Information
Parameter:ModelReferenceMinAlgLoopOccurrences
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-422
Model Referencing Pane
Application Setting
Efficiency No impact
Safety precaution Off
See Also
• Model block
• Algebraic Loops
• Model Blocks and Direct Feedthrough
• Diagnosing Simulation Errors
• Configuration Parameters Dialog Box
• Model Referencing Pane
1-423
1 Configuration Parameters Dialog Box
In this section...
“Simulation Target: General Tab Overview” on page 1-425
“Enable debugging/animation” on page 1-426
“Enable overflow detection (with debugging)” on page 1-428
“Ensure memory integrity” on page 1-430
“Echo expressions without semicolons” on page 1-432
“Use BLAS library for faster simulation” on page 1-434
“Ensure responsiveness” on page 1-436
“Simulation target build mode” on page 1-438
1-424
Simulation Target Pane: General
Configuration
Set the parameters that appear.
Dependency
If you have a Stateflow license, the title becomes Embedded MATLAB and
Stateflow. This title also appears if you do not have a Stateflow license, but
load a model that contains Stateflow charts or Truth Table blocks. In either
case, the parameters remain the same.
See Also
• Speeding Up Simulation
• Configuration Parameters Dialog Box
• Simulation Target Pane: General
1-425
1 Configuration Parameters Dialog Box
Enable debugging/animation
Enable debugging and animation during simulation of a model that contains
Embedded MATLAB Function blocks, Stateflow charts, or Truth Table blocks.
Settings
Default: On
On
Enables debugging and animation of a model during simulation.
Off
Disables debugging and animation of a model during simulation.
Tip
Command-Line Information
Parameter: SFSimEnableDebug
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging On
Traceability No impact
Efficiency Off
Safety precaution On
1-426
Simulation Target Pane: General
See Also
• Speeding Up Simulation
• Configuration Parameters Dialog Box
• Simulation Target Pane: General
1-427
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Enables overflow detection of data during simulation.
You must also select the Data Range check box in the Stateflow
Debugger window.
Off
Disables overflow detection of data during simulation.
Tips
Command-Line Information
Parameter: SFSimOverflowDetection
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging On
Traceability No impact
1-428
Simulation Target Pane: General
Application Setting
Efficiency Off
Safety precaution On
See Also
• Speeding Up Simulation
• Overflow Detection for Fixed-Point Types
• Configuration Parameters Dialog Box
• Simulation Target Pane: General
1-429
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Detect violations of memory integrity in code generated for Embedded
MATLAB function blocks and stops execution with a diagnostic message.
Off
Does not detect violations of memory integrity in code generated for
Embedded MATLAB function blocks.
Tips
Command-Line Information
Parameter: SimIntegrity
Type: string
Value: 'on' | 'off'
Default: 'on'
1-430
Simulation Target Pane: General
Recommended Settings
Application Setting
Debugging On
Traceability On
Efficiency Off
Safety precaution On
See Also
1-431
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Enables run-time output to appear in the MATLAB Command Window
during simulation.
Off
Disables run-time output from appearing in the MATLAB Command
Window during simulation.
Tip
Command-Line Information
Parameter: SFSimEcho
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging On
Traceability No impact
Efficiency Off
Safety precaution No impact
1-432
Simulation Target Pane: General
See Also
• Speeding Up Simulation
• Configuration Parameters Dialog Box
• Simulation Target Pane: General
1-433
1 Configuration Parameters Dialog Box
Settings
Default: On
On
Embedded MATLAB Function blocks in Simulink models and Embedded
MATLAB functions in Stateflow charts use Basic Linear Algebra
Subprograms (BLAS) libraries for low-level matrix operations.
Off
Embedded MATLAB Function blocks in Simulink models and Embedded
MATLAB functions in Stateflow charts do not use Basic Linear Algebra
Subprograms (BLAS) libraries for low-level matrix operations.
Command-Line Information
Parameter: SimBlas
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency On
Safety precaution No impact
1-434
Simulation Target Pane: General
See Also
1-435
1 Configuration Parameters Dialog Box
Ensure responsiveness
Enables responsiveness checks in code generated for Embedded MATLAB
function blocks.
Settings
Default: On
On
Enables periodic checks for Ctrl+C breaks in code generated for
Embedded MATLAB function blocks. Also allows graphics refreshing.
Off
Disables periodic checks for Ctrl+C breaks in code generated for
Embedded MATLAB function blocks. Also disables graphics refreshing.
Command-Line Information
Parameter: SimCtrlC
Type: string
Value: 'on' | 'off'
Default: 'on'
Recommended Settings
Application Setting
Debugging On
Traceability On
Efficiency Off
Safety precaution On
1-436
Simulation Target Pane: General
See Also
1-437
1 Configuration Parameters Dialog Box
Settings
Default: Incremental build
Incremental build
This option rebuilds only those portions of the target that you changed
since the last build.
Rebuild all (including libraries)
This option rebuilds the target, including libraries, from scratch.
Make without generating code
This option invokes the make process without generating code.
Clean all (delete generated code/executables)
This option deletes both generated source code and executable files.
Clean objects (delete executables only)
This option deletes only executable files.
Tips
• The default Incremental build is a good choice for most models. This
action takes place whenever you simulate your model.
• Set Rebuild all (including libraries) if you have changed your
compiler or updated your object files since the last simulation. For example,
use this option to rebuild the simulation target to include custom code
changes.
• Set Make without generating code when you have custom source files
that you must recompile in an incremental build mechanism that does not
detect changes in custom code files.
1-438
Simulation Target Pane: General
Command-Line Information
Parameter: SimBuildMode
Type: string
Value: 'sf_incremental_build' | 'sf_nonincremental_build' |
'sf_make' | 'sf_make_clean' | 'sf_make_clean_objects'
Default: 'sf_incremental_build'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-439
1 Configuration Parameters Dialog Box
In this section...
“Simulation Target: Symbols Tab Overview” on page 1-441
“Reserved names” on page 1-442
1-440
Simulation Target Pane: Symbols
Configuration
2 Click Apply.
See Also
1-441
1 Configuration Parameters Dialog Box
Reserved names
Enter the names of variables or functions in the generated code that match
the names of variables or functions specified in custom code for a model that
contains Embedded MATLAB Function blocks, Stateflow charts, or Truth
Table blocks.
Settings
Default: {}
Tips
config_param_object.set_param('SimReservedNameArray', {'abc','xyz'})
Command-Line Information
Parameter: SimReservedNameArray
Type: string array
Value: any reserved names shorter than 256 characters
Default: {}
1-442
Simulation Target Pane: Symbols
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-443
1 Configuration Parameters Dialog Box
In this section...
“Simulation Target: Custom Code Tab Overview” on page 1-446
“Source file” on page 1-447
1-444
Simulation Target Pane: Custom Code
In this section...
“Header file” on page 1-448
“Initialize function” on page 1-450
“Terminate function” on page 1-451
“Include directories” on page 1-452
“Source files” on page 1-454
“Libraries” on page 1-456
“Use local custom code settings (do not inherit from main model)” on page
1-458
1-445
1 Configuration Parameters Dialog Box
Configuration
1 Select the type of information to include from the list on the left side of
the pane.
2 Enter a string to identify the specific code, directory, source file, or library.
3 Click Apply.
See Also
1-446
Simulation Target Pane: Custom Code
Source file
Enter code lines to appear near the top of a generated source code file.
Settings
Default: ’ ’
Code lines appear near the top of the generated model.c source file, outside
of any function.
Command-Line Information
Parameter: SimCustomSourceCode
Type: string
Value: any source file name
Default: ''
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-447
1 Configuration Parameters Dialog Box
Header file
Enter code lines to appear near the top of a generated header file.
Settings
Default: ’ ’
Code lines appear near the top of the generated model.h header file.
Tips
• When you include a custom header file, enclose the file name in double
quotes. For example, #include "sample_header.h" is a valid declaration
for a custom header file.
• You can include extern declarations of variables or functions.
Command-Line Information
Parameter: SimCustomHeaderCode
Type: string
Value: any header file name
Default: ''
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-448
Simulation Target Pane: Custom Code
1-449
1 Configuration Parameters Dialog Box
Initialize function
Enter code statements that execute once at the start of simulation.
Settings
Default: ’ ’
Code appears inside the model’s initialize function in the model.c file.
Tip
• Use this code to invoke functions that allocate memory or to perform other
initializations of your custom code.
Command-Line Information
Parameter: SimCustomInitializer
Type: string
Value: any code
Default: ''
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-450
Simulation Target Pane: Custom Code
Terminate function
Enter code statements that execute at the end of simulation.
Settings
Default: ’ ’
Code appears inside the model’s terminate function in the model.c file.
Tip
• Use this code to invoke functions that free memory allocated by the custom
code or to perform other cleanup tasks.
Command-Line Information
Parameter: SimCustomTerminator
Type: string
Value: any code
Default: ''
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-451
1 Configuration Parameters Dialog Box
Include directories
Specify a list of directory paths that contain files you include in the compiled
target.
Settings
Default:''
Note If you specify a Windows® path string containing one or more spaces,
you must enclose the string in double quotes. For example, the second
and third path strings in the Include directories entry below must be
double-quoted:
Command-Line Information
Parameter: SimUserIncludeDirs
Type: string
Value: any directory file name
Default: ''
1-452
Simulation Target Pane: Custom Code
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-453
1 Configuration Parameters Dialog Box
Source files
Specify a list of source files to compile and link into the target.
Settings
Default:''
You can separate source files with a comma, a space, or a new line.
Note If you specify a Windows file name string containing one or more
spaces, you must enclose the string in double quotes. For example, the
second and third name strings in the Source files entry below must be
double-quoted:
Tip
• The file name is sufficient if the file is in the current MATLAB directory
or in one of the include directories.
Command-Line Information
Parameter: SimUserSources
Type: string
Value: any source file name
Default: ''
1-454
Simulation Target Pane: Custom Code
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-455
1 Configuration Parameters Dialog Box
Libraries
Specify a list of static libraries that contain custom object code to link into
the target.
Settings
Default:''
Note If you specify a Windows file name string containing one or more
spaces, you must enclose the string in double quotes. For example, the second
and third name strings in the Libraries entry below must be double-quoted:
Tip
• The file name is sufficient if the file is in the current MATLAB directory
or in one of the include directories.
Command-Line Information
Parameter: SimUserLibraries
Type: string
Value: any library file name
Default: ''
1-456
Simulation Target Pane: Custom Code
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
Efficiency No impact
Safety precaution No impact
See Also
1-457
1 Configuration Parameters Dialog Box
Settings
Default: Off
On
Enables a library model to use custom code settings that are unique
from the main model.
Off
Disables a library model from using custom code settings that are
unique from the main model.
Dependency
This parameter is available only for library models that contain Embedded
MATLAB Function blocks, Stateflow charts, or Truth Table blocks. To access
this parameter, select Tools > Open Simulation Target in the Embedded
MATLAB Editor or Stateflow Editor for your library model.
Command-Line Information
Parameter: SimUseLocalCustomCode
Type: string
Value: 'on' | 'off'
Default: 'off'
Recommended Settings
Application Setting
Debugging No impact
Traceability No impact
1-458
Simulation Target Pane: Custom Code
Application Setting
Efficiency No impact
Safety precaution No impact
See Also
1-459
1 Configuration Parameters Dialog Box
1-460
2
Library Browser
• The Sinks library selected from the Libraries pane (left-most pane)
• The Out1 block selected in the Library pane, which lists the blocks from
the library selected in the Libraries pane (Sinks, in this example)
• A Block Description pane for the Out1 block (the block selected in the
Library pane), at the bottom of the Library browser.
The Library Browser has a search box for searching for blocks or libraries
whose names that contain the search term you specify.
The Most Frequently Used Blocks pane displays a list of the blocks you
have added the most often.
2-2
About the Library Browser
For information about key tasks involving the Library Browser, see:
• “Populating a Model”
2-3
2 Library Browser
• “Adding Blocks”
• “Adding Libraries to the Library Browser”
2-4
Libraries Pane
Libraries Pane
In this section...
“About the Libraries Pane” on page 2-5
“Selecting Nodes” on page 2-6
“Expanding and Collapsing Nodes” on page 2-7
“Refreshing the Tree View” on page 2-7
2-5
2 Library Browser
Tree View
Selecting Nodes
You can use your keyboard or your mouse to select a node in the tree view.
To select a node with the mouse, first use the Libraries pane’s scroll bars, if
necessary, to move the node into view. Then click the node. To select a node
with the keyboard, use the keyboard’s Up or Down arrow key to move the
tree’s node selection cursor to the desired node.
Note Selecting a node can cause the Library Browser to update its library
data repository (see “Library Data Repository” on page 2-22). In this case, it
displays an advisory dialog box while the update is in process.
2-6
Libraries Pane
2-7
2 Library Browser
Library Pane
In this section...
“About the Library Pane” on page 2-8
“How to Tell Blocks from Libraries in the Library Pane” on page 2-9
“Choosing the Library Pane’s Layout” on page 2-10
“Setting Icon Size” on page 2-11
“Selecting Blocks” on page 2-12
“Creating an Instance of a Library Block in a Model” on page 2-12
“Displaying a Library Block’s Parameters” on page 2-12
“Displaying Help for a Library Block” on page 2-12
“Displaying the Contents of a Sublibrary” on page 2-12
“Displaying a Block or Sublibrary’s Parent” on page 2-13
2-8
Library Pane
You can use the Library pane to browse the contents of the selected library,
to view a library block’s parameters or help, and to create instances of library
blocks in models.
2-9
2 Library Browser
library block
2-10
Library Pane
Tip
Setting the Library Browser’s layout option to grid and its icon size to compact
(see “Setting Icon Size” on page 2-11) results in the most compact display of a
library’s contents in the Library pane.
2-11
2 Library Browser
Selecting Blocks
Many Library pane procedures require you to select a block displayed in the
pane. To select a block, click it with the mouse. The Library Browser moves
the block selection cursor to the selected block.
To create an instance of a library block in a new model, select the block in the
Library pane and then select Add to a new model from the library block’s
context menu or Add Selected Block to a New Model from the Library
Browser’s Edit menu.
Note The dialog box is disabled to prevent you from using it to change a
library block’s parameters.
2-12
Library Pane
2-13
2 Library Browser
2-14
Search Toolbar
Search Toolbar
In this section...
“About the Search Toolbar” on page 2-15
“Using the Search Toolbar to Find Blocks” on page 2-15
“Search Text Combo Box” on page 2-16
“Search Options Menu” on page 2-16
“Search Button” on page 2-17
1 Enter the string in the toolbar’s search text combo box (see “Search Text
Combo Box” on page 2-16).
2 Use the toolbar’s search options menu to specify the search options you
want to use, e.g., match whole words (see “Search Options Menu” on page
2-16).
2-15
2 Library Browser
The Library Browser searches the libraries installed on your system whose
names contain or match the search string you specified, depending on the
options you specified. It displays the results of the search in its Found pane
(see “Found Pane” on page 2-18).
2-16
Search Toolbar
Regular Expression
Treat search text as a MATLAB regular expression (see “Regular
Expressions”).
Match Case
Consider case when matching search text against block names.
Search Button
Selecting this button initiates a search of the block libraries on your system,
using the text string and search options specified in the toolbar’s search text
combo box (see “Search Text Combo Box” on page 2-16) and search options
menu (see “Search Options Menu” on page 2-16), respectively.
2-17
2 Library Browser
Found Pane
In this section...
“About the Found Pane” on page 2-18
“Selecting a Found Block in Library View” on page 2-19
“Displaying a Found Block’s Path” on page 2-20
2-18
Found Pane
Click to hide
or show blocks
found in this
library.
You can use the Found pane to perform many of the same tasks you can
perform with the Library pane, including creating instances of found blocks
in models and other libraries, displaying a found block’s parameters, and
displaying help for a found block. The procedures for these tasks are the same
as for the Library pane (see “Library Pane” on page 2-8 for more information).
2-19
2 Library Browser
2-20
Most Frequently Used Blocks Pane
For details, see “Selecting Your Most Frequently Used Blocks From the
Library Browser”.
2-21
2 Library Browser
2-22
Library Browser Keyboard Shortcuts
2-23
2 Library Browser
2-24
3
The Signal Properties dialog box lets you display and edit signal properties.
To display the dialog box, either
• Select the line that represents the signal whose properties you want to set
and then choose Signal Properties from the signal’s context menu or
from the Simulink Edit menu
or
• Select a block that outputs or inputs the signal and select Port Signal
Properties from the block’s context menu, then select the port to which
the signal is connected from the resulting menu
Signal name
Name of signal.
3-2
Signal Properties Controls
Note This option appears only for signals that originate from a virtual block
other than a Bus Selector block.
Show propagated signal names. You can select one of the following options:
Option Description
off Do not display signals represented by a virtual signal in the
signal’s label.
3-3
3 Signal Properties Dialog Box
Option Description
on Display the virtual and nonvirtual signals represented by
a virtual signal in the signal’s label. For example, suppose
that virtual signal s1 represents a nonvirtual signal s2 and
a virtual signal s3. If this option is selected, the label for
s1 is s1<s2, s3>.
all Display all the nonvirtual signals that a virtual signal
represents either directly or indirectly. For example, suppose
that virtual signal s1 represents a nonvirtual signal s2 and a
virtual signal s3 and virtual signal s3 represents nonvirtual
signals s4 and s5. If this option is selected, the label for s1
is s1<s2,s4,s5>.
3-4
Logging and Accessibility Options
Test point
Select this option to designate this signal as a test point. See “Working with
Test Points” for details.
Logging name
This pair of controls, consisting of a list box and an edit field, specifies the
name associated with logged signal data.
Simulink software uses the signal’s signal name as its logging name by
default. To specify a custom logging name, select Custom from the list box and
enter the custom name in the adjacent edit field.
Data
This group of controls enables you to limit the amount of data that Simulink
software logs for this signal.
3-5
3 Signal Properties Dialog Box
Decimation
Log every Nth data point where N is the number entered in the adjacent edit
field. For example, suppose that your model uses a fixed-step solver with a
step size of 0.1 s. if you select this option and accept the default decimation
value (2), Simulink software records data points for this signal at times 0.0,
0.2, 0.4, etc.
Storage class
Select the storage class of this signal from the list. See “Interfacing Signals
to External Code”,“Using the State Attributes Tab to Interface States to
External Code”, and “Storage Classes for Data Store Memory Blocks” for
information on how to use the listed options.
3-6
Documentation Options
Documentation Options
Description
Enter a description of the signal in this field.
Document link
Enter a MATLAB expression in the field that displays documentation for the
signal. To display the documentation, click “Document Link.” For example,
entering the expression
web(['file:///' which('foo_signal.html')])
3-7
3 Signal Properties Dialog Box
3-8
4
Simulink Preferences
Window
In this section...
“Simulink Preferences Window Overview” on page 4-3
“Window Reuse” on page 4-5
“Model File Change Notification” on page 4-7
“Updating or simulating the model” on page 4-8
“Action” on page 4-9
“First editing the model” on page 4-11
4-2
Simulink® Preferences Window: Main Pane
In this section...
“Saving the model” on page 4-12
“Autosave” on page 4-13
“Save before updating or simulating the model” on page 4-14
“Notify when loading an old model” on page 4-17
“Do not load models created with a newer version of Simulink” on page 4-18
“Callback tracing” on page 4-19
“Open the Sample Time Legend whenever Sample Time Display is changed”
on page 4-20
Configuration
1 On the root level pane, select the check boxes to configure preferences.
4-3
4 Simulink® Preferences Window
Click Apply to apply your changes and keep the window open.
Your settings affect the behavior of all Simulink models, including those
currently open, and all subsequent models. Your preference settings are
preserved for the next time you use the software.
See Also
• Model File Change Notification
• “Simulink Preferences Window: Main Pane” on page 4-2
• “Simulink Preferences Window: Display Defaults Pane” on page 4-21
• “Simulink Preferences Window: Font Defaults Pane” on page 4-28
• “Simulink Preferences Window: Configuration Defaults Pane” on page 4-30
4-4
Simulink® Preferences Window: Main Pane
Window Reuse
Specify whether to use the current window or open new windows to display a
subsystem or its parent.
Settings
Default: Mixed
Mixed
Mixed window reuse. Subsystem opens in its own window. When you
press Escape (go to parent), the parent window rises to the front, and
the subsystem window disappears.
None
Never reuse windows. Subsystem opens in a new window. Press
Escape: the parent window moves to the front.
Replace
Replace parent window. Subsystem opens in a new window. Parent
window disappears. Press Escape: the parent window appears, and
the subsystem window disappears.
Reuse
Reuse parent window. Subsystem replaces the parent in the current
window. Press Escape: the parent window replaces subsystem in
current window.
Tips
Command-Line Information
Parameter: WindowReuse
Type: string
4-5
4 Simulink® Preferences Window
4-6
Simulink® Preferences Window: Main Pane
4-7
4 Simulink® Preferences Window
Settings
Default: On
On
Notify if the model has changed on disk when updating or simulating
the model. Select the action to take in the Action list.
Off
Do not notify if the model has changed on disk when updating or
simulating the model.
Tip
To programmatically check whether the model has changed on disk since it
was loaded, use the function slIsFileChangedOnDisk.
Dependency
This parameter enablesAction.
Command-Line Information
Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenUpdating
Value: true | false | 1 | 0
Default: true
See Also
Model File Change Notification
4-8
Simulink® Preferences Window: Main Pane
Action
Select what action to take if the file has changed on disk since it was loaded.
Settings
Default: Warning
Warning
Displays a warning in MATLAB command window
Error
Displays an error, at the MATLAB command window if simulating from
the command line, or if simulating from a menu item, in the Simulation
Diagnostics window.
Reload model (if unmodified)
Reloads if the model is unmodified. If the model is modified, you see
the prompt dialog.
Show prompt dialog
Shows prompt dialog. In the dialog, you can choose to close and reload,
or ignore the changes.
Tip
To programmatically check whether the model has changed on disk since it
was loaded, use the function slIsFileChangedOnDisk.
Dependencies
This parameter is enabled by the parameter Updating or simulating the
model.
Command-Line Information
Parameter: MdlFileChangedOnDiskHandling
Type: string
Value: 'Warning' | 'Error' | 'Reload model (if unmodified)' |
'Show prompt dialog'
Default: 'Warning'
4-9
4 Simulink® Preferences Window
See Also
Model File Change Notification
4-10
Simulink® Preferences Window: Main Pane
Settings
Default: On
On
Displays a warning if the file has changed on disk when you modify
the block diagram. Any graphical operation that modifies the block
diagram (e.g., adding a block) causes a warning dialog to appear. Any
command-line operation that causes the block diagram to be modified
(e.g., a call to set_param) will result in a warning like this at the
command line:
Off
Do not check for changes on disk when first editing the model.
Tip
To programmatically check whether the model has changed on disk since it
was loaded, use the function slIsFileChangedOnDisk.
Command-Line Information
Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenEditing
Value: true | false | 1 | 0
Default: true
See Also
Model File Change Notification
4-11
4 Simulink® Preferences Window
Settings
Default: On
On
Notify if the file has changed on disk when you save the model.
• The save_system function displays an error, unless the
OverwriteIfChangedOnDisk option is used.
• Saving the model by using the menu (File > Save) or a keyboard
shortcut causes a dialog to be shown. In the dialog, you can choose to
overwrite, save with a new name, or cancel the operation.
Off
Do not check for changes on disk when saving the model.
Tip
To programmatically check whether the model has changed on disk since it
was loaded, use the function slIsFileChangedOnDisk.
Command-Line Information
Parameter: MDLFileChangedOnDiskChecks
Type: struct, field name: CheckWhenSaving
Value: true | false | 1 | 0
Default: true
See Also
Model File Change Notification
4-12
Simulink® Preferences Window: Main Pane
Autosave
Use this preference to specify whether to automatically save a backup copy of
the model before updating or simulating.
For more information, see the check box control “Save before updating or
simulating the model” on page 4-14.
4-13
4 Simulink® Preferences Window
Settings
Default: On
On
If the model has unsaved changes, automatically save a backup copy
of the model before updating or simulating. This autosave copy can be
useful for crash recovery.
The copy is saved in the same directory as the model, with the name
MyModel.mdl.autosave.
Off
Do not automatically save a copy before updating or simulating.
Tips
If you open or load a model with a more recent autosave copy available, the
model loads, and the non-modal dialog Model Recovery appears.
• Restore — Overwrite the original model file with the autosave copy, and
delete the autosave copy.
If you select the check box to Keep a copy of original model file, you can
save copies of the original model files named MyModel.mdl.original.
• Delete Autosave — Delete the autosave copy, and do nothing else.
• Ignore — Do nothing. This leaves the model and the autosave copy
untouched. The Model Recovery dialog will reappear the next time you
open the model, so you can choose to restore or delete autosave files later.
4-14
Simulink® Preferences Window: Main Pane
Select a check box for each model in the list to specify whether to restore,
delete autosave, or ignore. You can click the Restore All, Delete All or
Ignore All buttons to select that option for all models.
The default option is Ignore All. If you click OK without making any
changes, your models and autosave copies are left untouched. The next time
you open the model, the Model Recovery dialog will reappear and you can
choose again whether to restore or delete any autosave copies.
Caution If you restore, any changes made since your last save will be lost.
If a segmentation violation occurred, note that the last autosave file for
the model reflects the state of the autosave data prior to the segmentation
violation. Because Simulink models might be corrupted by a segmentation
violation, a model is not autosaved after a segmentation violation occurs.
4-15
4 Simulink® Preferences Window
Command-Line Information
Parameter: AutoSaveOptions
Type: struct, field name: SaveOnModelUpdate
Value: true | false | 1 | 0
Default: true
4-16
Simulink® Preferences Window: Main Pane
Settings
Default: Off
On
Print a message in the command window when loading a model last
saved in an old version of Simulink software.
Off
No notification when loading old models.
Tips
Command-Line Information
Parameter: NotifyIfLoadOldModel
Type: string
Value: 'on' | 'off'
Default: off
4-17
4 Simulink® Preferences Window
Settings
Default: Off
On
Do not load any model last saved in a newer version of Simulink
software, and print an error message in the command window.
Off
Load models last saved in a newer version of Simulink software, and
print a warning message in the command window.
Tip
If possible, use the Save As command to convert the block diagram to the
format of the desired version of Simulink software. The Save As command
allows you to save a model created with the latest version of the Simulink
software in formats used by earlier versions. See “Saving a Model in an
Earlier Simulink Version”.
Command-Line Information
Parameter: ErrorIfLoadNewModel
Type: string
Value: 'on' | 'off'
Default: off
4-18
Simulink® Preferences Window: Main Pane
Callback tracing
Specify whether to display the model callbacks that Simulink software
invokes when simulating a model.
Settings
Default: Off
On
Display the model callbacks in the MATLAB command window as they
are invoked.
Off
Do not display model callbacks.
Command-Line Information
Parameter: CallbackTracing
Type: string
Value: 'on' | 'off'
Default: 'off'
4-19
4 Simulink® Preferences Window
Settings
Default: On
On
Display the Sample Time Legend whenever you change Sample Time
Display by selecting Colors, Annotations, or All from the Sample Time
Display submenu. The model diagram is updated and the legend opens.
Off
Do not display the Sample Time Legend whenever Sample Time Display
is changed.
Command-Line Information
Parameter: OpenLegendWhenChangingSampleTimeDisplay
Type: string
Value: 'on' | 'off'
Default: 'on'
4-20
Simulink® Preferences Window: Display Defaults Pane
In this section...
“Simulink Display Defaults Overview” on page 4-22
“Show masked subsystems” on page 4-23
“Show library links” on page 4-24
“Browser visible” on page 4-25
4-21
4 Simulink® Preferences Window
In this section...
“Wide nonscalar lines” on page 4-26
“Show port data types” on page 4-27
Configuration
1 Select check boxes to configure display properties that will be applied to all
new block diagrams.
Click Apply to apply your changes and keep the window open.
See Also
4-22
Simulink® Preferences Window: Display Defaults Pane
Settings
Default: Off
On
Display masked subsystems and their contents in the Model Browser.
Off
Do not display masked subsystems and their contents in the Model
Browser.
Command-Line Information
Parameter: BrowserLookUnderMasks
Type: string
Value: 'on' | 'off'
Default: 'off'
4-23
4 Simulink® Preferences Window
Settings
Default: Off
On
Display library links and their contents in the Model Browser.
Off
Do not display library links and their contents in the Model Browser.
Command-Line Information
Parameter: BrowserShowLibraryLinks
Type: string
Value: 'on' | 'off'
Default: 'off'
4-24
Simulink® Preferences Window: Display Defaults Pane
Browser visible
Specify whether the Model Browser (Windows only) is shown when you open
a model.
Settings
Default: Off
On
Display the Model Browser.
Off
Do not display the Model Browser.
Command-Line Information
Parameter: ModelBrowserVisibility
Type: string
Value: 'on' | 'off'
Default: 'off'
4-25
4 Simulink® Preferences Window
Settings
Default: Off
On
Show thick lines for nonscalar connections between blocks
Off
Do not show thick lines for nonscalar connections between blocks
Command-Line Information
Parameter: WideVectorLines
Type: string
Value: 'on' | 'off'
Default: 'off'
4-26
Simulink® Preferences Window: Display Defaults Pane
Settings
Default: Off
On
Display the data type for each port on each block.
Off
Do not display data types on block ports.
Command-Line Information
Parameter: ShowPortDataTypes
Type: string
Value: 'on' | 'off'
Default: 'off'
4-27
4 Simulink® Preferences Window
Configuration
1 Use the drop-down lists to specify font types, styles, and sizes that will be
applied to all new block diagrams.
4-28
Simulink® Preferences Window: Font Defaults Pane
Click Apply to apply your changes and keep the window open.
4-29
4 Simulink® Preferences Window
4-30
Simulink® Preferences Window: Configuration Defaults Pane
Configuration
1 Expand the tree under Configuration Defaults to edit the template for
default Configuration Parameters.
2 Edit Configuration Parameters that you want to apply to all new block
diagrams.
Click Apply to apply your changes and keep the window open.
See Also
“Configuration Parameters Dialog Box Overview” on page 1-2
4-31
4 Simulink® Preferences Window
4-32
5
• To create a new mask, select the block to be masked, then choose Mask
BlockType from the model window’s Edit menu or the block’s context
menu.
• To edit an existing mask, select the masked block, then choose Edit Mask
from the model window’s Edit menu or the block’s context menu.
A Mask Editor like the following appears. If the block is already masked, the
current mask specification appears in the editor, allowing you to change the
mask as needed. Otherwise, the editor is initially empty:
5-2
Mask Editor Overview
The Mask Editor contains a set of tabbed panes, each of which enables you to
define a feature of the mask:
• The Icon & Ports pane enables you to define the block icon. See “Icon
& Ports Pane” on page 5-5.
• The Parameters pane enables you to define and describe mask dialog
box parameter prompts, and to name the variables associated with the
parameters. See “Parameters Pane” on page 5-12.
• The Initialization pane enables you to specify initialization commands.
See “Initialization Pane” on page 5-22.
• The Documentation pane enables you to define the mask type and specify
the block description and the block help. See “Documentation Pane” on
page 5-25.
5-3
5 Simulink® Mask Editor
• The Unmask button deactivates the mask and closes the Mask Editor.
While the model is still active, the mask information is still retained so
that you can reactivate it.
To reactivate the mask, select the block and choose Mask Subsystem. The
Mask Editor opens, displaying the previous settings. Click OK or Apply
to restore the mask.
When you close the model, the inactive mask information is discarded.
If you want the mask information after this, you will need to recreate it
the next time you open the model.
• The OK button applies the mask settings on all panes and closes the Mask
Editor.
• The Cancel button closes the Mask Editor without applying any changes
made since you last clicked the Apply button.
• The Help button displays online information about the Mask Editor.
• The Apply button applies the mask settings on all panes and leaves the
Mask Editor open.
To see the system under the mask without unmasking it, select the Subsystem
block, then select Look Under Mask from the Edit menu or the block’s
context menu. This command opens the subsystem. The block’s mask is not
affected.
5-4
Icon & Ports Pane
The Icon & Ports pane contains the controls described in this section.
5-5
5 Simulink® Mask Editor
Drawing commands
This field allows you to enter commands that draw the block’s icon. A set of
commands is provided that can display text, one or more plots, or show a
transfer function, as described in “Mask Icon Drawing Commands”
. You must use only these commands to draw your icon. The drawing
commands are executed in the order in which they appear in this field.
Drawing commands have access to all variables in the mask workspace. If
the drawing commands cannot be successfully executed, the icon displays
three question marks.
5-6
Icon & Ports Pane
Block Frame
The icon frame is the rectangle that encloses the block. You can choose to
show or hide the frame by setting the Frame parameter to Visible or
Invisible. The default is to make the icon frame visible. For example, this
figure shows visible and invisible icon frames for an AND gate block.
Icon Transparency
The icon can be set to Opaque or Transparent, either hiding or showing what
is underneath the icon. Opaque, the default, covers information the Simulink
software draws, such as port labels. This figure shows opaque and transparent
icons for an AND gate block. Notice the text on the transparent icon.
Icon Units
This option controls the coordinate system used by the drawing commands. It
applies only to plot and text drawing commands. You can select from among
these choices: Autoscale, Normalized, and Pixel.
• Autoscale scales the icon to fit the block frame. When the block is resized,
the icon is also resized. For example, this figure shows the icon drawn
using these vectors:
X = [0 2 3 4 9]; Y = [4 6 3 5 8];
5-7
5 Simulink® Mask Editor
The lower-left corner of the block frame is (0,3) and the upper-right corner
is (9,8). The range of the x-axis is 9 (from 0 to 9), while the range of the
y-axis is 5 (from 3 to 8).
• Normalized draws the icon within a block frame whose bottom-left corner
is (0,0) and whose top-right corner is (1,1). Only X and Y values between
0 and 1 appear. When the block is resized, the icon is also resized. For
example, this figure shows the icon drawn using these vectors:
• Pixel draws the icon with X and Y values expressed in pixels. The icon
is not automatically resized when the block is resized. To force the icon to
resize with the block, define the drawing commands in terms of the block
size.
Icon Rotation
When the block is rotated or flipped, you can choose whether to rotate or flip
the icon or to have it remain fixed in its original orientation. The default is
not to rotate the icon. The icon rotation is consistent with block port rotation.
This figure shows the results of choosing Fixed and Rotates icon rotation
when the AND gate block is rotated.
5-8
Icon & Ports Pane
Port Rotation
The Icon & Ports > Port Rotation port option lets you specify a masked
block’s port rotation type. The choices are:
• default
Ports are reordered after a clockwise rotation to maintain a left-to-right
port numbering order for ports along the top and bottom of the block and
a top-to-bottom port numbering order for ports along the left and right
sides of the block.
• physical
Ports rotate with the block without being reordered after a clockwise
rotation.
The default rotation option is appropriate for control systems and other
modeling applications where block diagrams typically have a top-down and
left-right orientation. It simplifies editing of diagrams by minimizing the need
to reconnect blocks after rotations to preserve the standard orientation.
For example, the following figure shows two diagrams representing the same
transistor circuit. In one, the masked blocks representing transistors use
default rotation; in the other, physical rotation.
5-9
5 Simulink® Mask Editor
Both diagrams avoid line crossings that make diagrams harder to read. The
next figure shows the diagrams after a single clockwise rotation.
5-10
Icon & Ports Pane
Note that the rotation introduces a line crossing in the diagram that uses
default rotation but not in the diagram that uses physical rotation. Note also
that there is no way to edit the diagram with default rotation to remove the
line crossing. See “Changing a Block’s Orientation” for more information.
5-11
5 Simulink® Mask Editor
Parameters Pane
In this section...
“About the Parameters Pane” on page 5-12
“Dialog Parameters Panel” on page 5-13
“Control Types” on page 5-15
“Options for Selected Parameter Panel” on page 5-18
“Parameter Buttons” on page 5-20
5-12
Parameters Pane
• The Dialog parameters panel allows you to select and change the major
properties of the mask’s parameters. See “Dialog Parameters Panel” on
page 5-13 for more information.
• The Options for selected parameter panel allows you to set additional
options for the parameter selected in the Dialog parameters panel.
• The buttons on the left side of the Parameters pane allow you to add,
delete, and change the order of appearance of parameters on the mask’s
parameter dialog box. See “Dialog Parameters Panel” on page 5-13 for
more information.
Prompt
Text that identifies the parameter on a masked subsystem’s dialog box.
Variable
Name of the variable that stores the parameter’s value in the mask’s
workspace. You can use this variable as the value of parameters of blocks
inside the masked subsystem, thereby allowing the user to set the parameters
via the mask dialog box.
5-13
5 Simulink® Mask Editor
get_param('MyModel/A', 'voLUME')
However, case does matter when using a mask variable as the value of a
block parameter inside the masked subsystem. For example, suppose a
Gain block inside the masked subsystem A specifies VOLUME as the value of
its Gain parameter. This variable name does not resolve in the masked
subsystem’s workspace, as it contains a mask variable named Volume. If
the base workspace does not contain a variable named VOLUME, simulating
MyModel produces an error.
The mask variable name set by the Variable field cannot duplicate any
parameter name in or beneath the mask. Thus you cannot use any built-in
block parameter name, such as name, as a mask variable name. Violating this
requirement will cause an error when you apply changes in the Mask Editor.
Type
Type of control used to edit the value of this parameter. The control appears
on the mask’s parameter dialog box following the parameter prompt. The
button that follows the type name in the Parameters pane pops up a list of
supported commands To change the current control type, select another type
from the list. See “Control Types” on page 5-15 for more information.
Evaluate
Simulink can use the value of a mask parameter as the user enters it in the
Mask Parameters dialog box, or it can evaluate what the user specifies and
use the result of the evaluation. Select the parameter’s Evaluate option in
the Dialog parameters table to specify parameter evaluation (the default)
or clear the option to suppress evaluation. The effect of the Evaluate option
depends on the control type, as shown in “Control Types” on page 5-15.
5-14
Parameters Pane
If checked, this option causes the Simulink software to evaluate the expression
entered by the user before it is assigned to the variable. Otherwise, the
expression itself is treated as a string value and is assigned to the variable.
For example, if the user enters the expression gain in an edit field and the
Evaluate option is checked, gain is evaluated and the result is assigned to
the variable. Otherwise, the string 'gain' is assigned to the variable. See
“Check Box Control” on page 5-17 and “Pop-Up Control” on page 5-17 for
information about how this option affects evaluation of the parameters.
If you need both the string entered and the evaluated value, clear the
Evaluate option. To get the value of a base workspace variable entered as
the literal value of the mask parameter, use the MATLAB evalin command
in the mask initialization code. For example, suppose the user enters the
string 'gain' as the literal value of the mask parameter k where gain is the
name of a base workspace variable. To obtain the value of the base workspace
variable, use the following command in the mask’s initialization code:
value = evalin('base', k)
Tunable
Select the parameter’s Tunable option in the Mask Parameters dialog box
to specify that the value of the parameter can be changed during simulation
(the default) or clear the option to specify that the parameter value cannot be
changed. If the masked block does not support parameter tuning, Simulink
ignores the setting of a mask parameter’s Tunable option. See “Changing
the Values of Block Parameters During Simulation” for information about
parameter tuning and the blocks that support it.
Control Types
You can choose how parameter values are entered or selected. You can create
three styles of controls: edit fields, check boxes, and pop-up controls. To
specify the type of control that the Mask Parameters dialog box provides for
a mask parameter, set the parameter’s Type pulldown to edit, checkbox,
or popup:
5-15
5 Simulink® Mask Editor
• A check box control enables the user to choose between two alternatives by
selecting or deselecting a check box.
• A pop-up control enables the user to choose a parameter value from a list of
possible values.
For example, this figure shows the Parameters pane of a Mask Parameters
dialog box that uses all three types of controls, with the pop-up control open
to show its possible values:
Edit Control
An edit field enables the user to enter a parameter value by typing it into
a field. This figure shows how the prompt for the sample edit control was
defined.
5-16
Parameters Pane
The value of the variable associated with the parameter depends on whether
the Evaluate option is selected.
Check Box
Parameter
Evaluation State Check Box Parameter Value
On Selected 1
Cleared 'on'
Off Selected 0
Cleared 'off'
Pop-Up Control
A pop-up enables the user to choose a parameter value from a list of possible
values. When you define a Pop-Up control, you must specify the values that
the control presents to the user in the Mask Parameters dialog box. To specify
the values, select the parameter in the Dialog parameters table, then enter
the values in the Popups field of the Options for selected parameter
pane below the table. The next figure shows a pop-up control definition
5-17
5 Simulink® Mask Editor
The value of the variable associated with the parameter (Color) depends
on the item selected from the pop-up list and whether the Evaluate option
is checked (on).
Pop-Up Evaluation
Show parameter
The selected parameter appears on the masked block’s parameter dialog box
only if this option is checked (the default).
5-18
Parameters Pane
Enable parameter
Clearing this option grays the selected parameter’s prompt and disables its
edit control. This means that the user cannot set the value of the parameter.
Popups
This field is enabled only if the edit control for the selected parameter is a
pop-up. Enter the values of the pop-up control in this field, each on a separate
line.
Callback
Enter the MATLAB code that you want the Simulink software to execute
when a user applies a change to the selected parameter by selecting the
Apply or OK button on the mask dialog box. You can use such callbacks to
create dialogs whose appearance changes, depending on changes to control
settings made by the user, such as enabling an edit field when a user checks
a check box.
Note Callbacks are not intended to be used to alter the contents of a masked
subsystem. Altering a masked subsystem’s contents in a callback, for example
by adding or deleting blocks or changing block parameter values, can trigger
errors during model update or simulation. If you need to modify the contents
of a masked subsystem, use the mask’s initialization code to perform the
modifications. See “Initialization Pane” on page 5-22 for more information.
The callback can create and reference variables only in the block workspace.
If the callback needs the value of a mask parameter, it can use get_param to
obtain the value, for example:
if str2num(get_param(gcb, 'g'))<0
error('Gain is negative.')
end
• Open the mask parameter dialog box. Callback commands execute top
down, starting with the top mask dialog parameter
5-19
5 Simulink® Mask Editor
• Modify a parameter value in the mask parameter dialog box then change
the cursor’s focus by pressing the Tab key or clicking into another field
in the dialog
Note The callback commands are not executed when the parameter value
is modified using the set_param command.
• Modify the parameter value, either in the mask parameter dialog box or via
a call to set_param, than apply the change by clicking Apply or OK. Any
mask initialization commands execute after the callback commands. See
“Initialization Pane” on page 5-22 for more information.
• Cancel any applied changes made in the mask dialog box by clicking
Cancel.
• Hover over the masked block to see the block’s data tip, when the data tip
contains parameter names and values. The callback executes again when
the block data tip disappears.
Note The callback commands do not execute if the mask dialog box is
open when the block data tip appears.
Parameter Buttons
This table explains the purpose of the buttons that appear on the Parameters
pane in the order of their appearance from the top of the pane.
5-20
Parameters Pane
For example, this figure shows the result of clicking the Add button to create
the first parameter defined by a mask:
Add
New parameter
5-21
5 Simulink® Mask Editor
Initialization Pane
In this section...
“About the Initialization Pane” on page 5-22
“Dialog variables” on page 5-23
“Initialization commands” on page 5-24
“Allow library block to modify its contents” on page 5-24
“Initialization Command Limitations” on page 5-24
When you open a model, initialization commands execute for all masked
blocks that are visible because they reside at the top level of the model or in
5-22
Initialization Pane
an open subsystem. Initialization commands for masked blocks that are not
initially visible execute when you open the subsystem or model that contains
the blocks.
When you load a model into memory without displaying the model graphically,
no initialization commands initially run for any masked blocks. See “Loading
a Model” and load_system for information about loading a model without
displaying it.
Initialization commands for all masked blocks in a model run when you:
• Change any of the parameters that define the mask, such as MaskDisplay
and MaskInitialization, by using the Mask Editor or set_param.
• Change the appearance of the masked block, for example by resizing or
rotating the block.
• Change the value of a mask parameter by using the block dialog or
set_param.
• Copy the masked block within the same model or between different models.
Dialog variables
The Dialog variables list displays the names of the variables associated
with the subsystem’s mask parameters, which are defined in the Parameters
pane. You can copy the name of a parameter from this list and paste it into
the adjacent Initialization commands field, using the Simulink keyboard
copy and paste commands. You can also use the list to change the names of
mask parameter variables. To change a name, double-click the name in the
list. An edit field containing the existing name appears. Edit the existing
name and press Enter or click outside the edit field to confirm your changes.
5-23
5 Simulink® Mask Editor
Initialization commands
Enter the initialization commands in this field. You can enter any valid
MATLAB expression, consisting of MATLAB functions and scripts, operators,
and variables defined in the mask workspace. Initialization commands run
in the mask workspace, not the base workspace. Terminate initialization
commands with a semicolon to avoid echoing results to the MATLAB
Command Window.
5-24
Documentation Pane
Documentation Pane
In this section...
“About the Documentation Pane” on page 5-25
“Mask Type Field” on page 5-26
“Mask Description Field” on page 5-26
“Mask Help Field” on page 5-26
The next figure shows the relationship between the values in the
Documentation pane and the appearance of the corresponding Mask
Parameters dialog box and Online Help window.
5-25
5 Simulink® Mask Editor
• URL specification
• web or eval command
• Literal or HTML text
Providing a URL
If the first line of the Mask help field is a URL, Simulink passes the URL
to your default web browser. The URL can begin with http:, www:, file:,
ftp:, or mailto:. Examples:
http://www.mathworks.com
file:///c:/mydir/helpdoc.html
5-26
Documentation Pane
Once the browser is active, MATLAB and Simulink have no further control
over its actions.
See the MATLAB web command documentation for details. A web command
used for mask help cannot return values.
eval('!Word My_Spec.doc')
Simulink first copies the text to a temporary directory, then displays the
text using the web command. If you want the text to display an image, you
can provide a URL path to the image file, or you can place the image file in
the temporary directory. Use tempdir to find the temporary directory that
Simulink uses for your system.
5-27