Documentation

Diagnostics Pane: Data Validity

Data Validity Diagnostics Overview

Specify what diagnostic action Simulink® software should take, if any, when it detects a condition that could compromise the integrity of data defined by the model, as well as the Data Validity parameters that pertain to code generation, and are used to debug a model.

Configuration

Set the parameters displayed.

Tips

  • To open the Data Validity pane, in the Simulink Editor, select Simulation > Model Configuration Parameters > Diagnostics > Data Validity.

  • The options are typically to do nothing or to display a warning or an error message.

  • A warning does not terminate a simulation, but an error does.

See Also

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.

  • 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.

Command-Line Information

Parameter: SignalResolutionControl
Type: string
Value: 'UseLocalSettings' | 'TryResolveAll' | 'TryResolveAllWithWarning'
Default: 'UseLocalSettings'
SignalResolutionControl ValueEquivalent Signal Resolution Value
'UseLocalSettings'Explicit only
'TryResolveAll'Explicit and implicit
'TryResolveAllWithWarning'Explicit and warn implicit

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionExplicit only

See Also

Division by singular matrix

Select the diagnostic action to take if the Product block detects a singular matrix while inverting one of its inputs in matrix multiplication mode.

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

For models referenced in Accelerator mode, Simulink ignores the Division by singular matrix parameter setting if you set it to a value other than None.

You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.

  1. In the Simulink Editor, select Analysis > Model Advisor.

  2. Select By Task.

  3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: CheckMatrixSingularityMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Underspecified data types

Select the diagnostic action to take if Simulink software could not infer the data type of a signal during data type propagation.

Identify and Resolve Underspecified Data Types

This example shows how to use the configuration parameter Underspecified data types to identify and resolve an underspecified data type.

  1. Open the example model ex_underspecified_data_types.

  2. On the Configuration Parameters > Diagnostics > Data Validity pane, set Underspecified data types to warning.

  3. Update the diagram.

    The signals in the model use the data type uint8, and the model generates a warning.

  4. Open the Diagnostic Viewer. The warning indicates that the output signal of the Constant block has an underspecified data type.

  5. Open the Constant block dialog box.

    On the Signal Attributes tab, Output data type is set to Inherit: Inherit via back propagation. The Constant block output inherits a data type from the destination block. In this case, the destination is the Sum block.

  6. Open the Sum block dialog box.

    On the Signal Attributes tab, Accumulator data type is set to Inherit: Inherit via internal rule. Sum blocks cast all of their input signals to the selected accumulator data type. In this case, the accumulator data type is specified as an inherited type.

  7. Open the Inport block dialog box. On the Signal Attributes tab, Data type is set to uint8.

The data type of the Constant block output signal is underspecified because the source and destination blocks each apply an inherited data type. The signal cannot identify a data type to inherit. However, the model uses heuristic rules to determine the most appropriate type to use, uint8.

To resolve the underspecified data type, you can use one of these techniques:

  • On the Signal Attributes tab of the Constant block dialog box, specify Output data type as a particular numeric type, such as uint8.

  • On the Signal Attributes tab of the Sum block dialog box, select the check box Require all inputs to have the same data type.

    With this setting, the Sum block applies the data type of the first input, uint8, to the underspecified data type of the second input.

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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Simulation range checking

Select the diagnostic action to take when signals exceed specified minimum or maximum values.

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

  • Use a block's Output minimum or Minimum parameter to specify the minimum value that the block should output.

  • Use a block's Output maximum or Maximum parameter to specify the maximum value that the block should output.

  • Enable this diagnostic to check whether block outputs exceed the minimum or maximum values that you specified.

  • When Simulation range checking is enabled, Simulink software performs signal range checking at every time step during a simulation. Setting this diagnostic to warning or error can cause a decrease in simulation performance.

  • For models referenced in Accelerator mode, Simulink ignores the Simulation range checking parameter setting if you set it to a value other than None.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: SignalRangeChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
Debuggingwarning or error
Traceabilitywarning or error
Efficiencynone
Safety precautionerror

See Also

Wrap on overflow

Select the diagnostic action to take if the value of a signal overflows the signal data type and wraps around.

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 which wrap for integer and fixed-point data types.

  • This diagnostic also reports division by zero for all data types, including floating-point data types.

  • To check for floating-point overflows (for example, Inf or NaN) for double or single data types, select the Inf or NaN block output diagnostic. (See Inf or NaN block output for more information.)

  • For models referenced in Accelerator mode, Simulink ignores the Wrap on overflow parameter setting if you set it to a value other than None.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: IntegerOverflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Saturate on overflow

Select the diagnostic action to take if the value of a signal is too large to be represented by the signal data type, resulting in a saturation.

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 which saturate for integer and fixed-point data types.

  • To check for floating-point overflows (for example, Inf or NaN) for double or single data types, select the Inf or NaN block output diagnostic. (See Inf or NaN block output for more information.)

Command-Line Information

Parameter: IntegerSaturationMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Inf or NaN block output

Select the diagnostic action to take if the value of a block output is Inf or NaN at the current time step.

    Note:   Accelerator mode does not support any runtime diagnostics.

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 floating-point overflows for double or single data types.

  • To check for integer and fixed-point overflows, select the Wrap on overflow diagnostic. (See Wrap on overflow for more information.)

  • For models referenced in Accelerator mode, Simulink ignores the Info or NaN block output parameter setting if you set it to a value other than None.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: SignalInfNanChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

"rt" prefix for identifiers

Select the diagnostic action to take during code generation if a Simulink object name (the name of a parameter, block, or signal) begins with rt.

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

  • The default setting (error) causes code generation to terminate with an error if it encounters a Simulink object name (parameter, block, or signal), that begins with rt.

  • This is intended to prevent inadvertent clashes with generated identifiers whose names begins with rt.

Command-Line Information

Parameter: RTPrefix
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

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

  • A parameter downcast occurs if the computation of block output required converting the parameter's specified type to a type having a smaller range of values (for example, from uint32 to uint8).

  • This diagnostic applies only to named tunable parameters.

Command-Line Information

Parameter: ParameterDowncastMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

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

  • A parameter overflow occurs if Simulink software encounters a parameter whose data type's range is not large enough to accommodate the parameter's ideal value (the ideal value is either too large or too small to be represented by the data type). For example, suppose that the parameter's ideal value is 200 and its data type is int8. Overflow occurs in this case because the maximum value that int8 can represent is 127.

  • Parameter overflow differs from parameter precision loss, which occurs when the ideal parameter value is within the range of the data type and scaling being used, but cannot be represented exactly.

  • Both parameter overflow and precision loss are quantization errors, and the distinction between them can be a fine one. The Detect overflow diagnostic reports all quantization errors greater than one bit. For very small parameter quantization errors, precision loss will be reported rather than an overflow when

    (Max+Slope)Videal>(MinSlope)

    where

    • Max is the maximum value representable by the parameter data type

    • Min is the minimum value representable by the parameter data type

    • Slope is the slope of the parameter data type (slope = 1 for integers)

    • Videal is the ideal value of the parameter

Command-Line Information

Parameter: ParameterOverflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

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

  • Parameter underflow occurs when Simulink software encounters a parameter whose data type does not have enough precision to represent the parameter's ideal value because the ideal value is too small.

  • When parameter underflow occurs, casting the ideal value to the data type causes the parameter's modeled value to become zero, and therefore to differ from its ideal value.

Command-Line Information

Parameter: ParameterUnderflowMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Detect precision loss

Select the diagnostic action to take when parameter precision loss occurs during simulation.

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

  • Precision loss occurs when Simulink software encounters a parameter whose data type does not have enough precision to represent the parameter's value exactly. As a result, the modeled value differs from the ideal value.

  • Parameter precision loss differs from parameter overflow, which occurs when the range of the parameter's data type, i.e., that maximum value that it can represent, is smaller than the ideal value of the parameter.

  • Both parameter overflow and precision loss are quantization errors, and the distinction between them can be a fine one. The Detect Parameter overflow diagnostic reports all parameter quantization errors greater than one bit. For very small parameter quantization errors, precision loss will be reported rather than an overflow when

    (Max+Slope)Videal>(MinSlope)

    where

    • Max is the maximum value representable by the parameter data type.

    • Min is the minimum value representable by the parameter data type.

    • 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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Detect loss of tunability

Select the diagnostic action to take when an expression with tunable variables is reduced to its numerical equivalent.

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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Detect read before write

Select the diagnostic action to take if the model attempts to read data from a data store to which it has not written data in this time step.

Settings

Default: Use local settings

Use local settings

For each local data store (defined by a Data Store Memory block or Simulink.Signal object in a model workspace) use the setting specified by the block. For each global data store (defined by a Simulink.Signal object in the base workspace) disable the diagnostic.

Disable all

Disables this diagnostic for all data stores accessed by the model.

Enable all as warnings

Displays diagnostic as a warning at the MATLAB® command line.

Enable all as errors

Halts the simulation and displays the diagnostic in an error dialog box.

    Note:   During model referencing simulation in Accelerator and Rapid Accelerator mode, if the Detect read before write parameter is set to Enable all as warnings, Enable all as errors, or Use local settings, Simulink temporarily changes the setting to Disable all.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration this parameter setting during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: ReadBeforeWriteMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' | 'EnableAllAsError'
Default: 'UseLocalSettings'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionEnable all as errors

See Also

Detect write after read

Select the diagnostic action to take if the model attempts to write data to a data store after previously reading data from it in the current time step.

Settings

Default: Use local settings

Use local settings

For each local data store (defined by a Data Store Memory block or Simulink.Signal object in a model workspace) use the setting specified by the block. For each global data store (defined by a Simulink.Signal object in the base workspace) disable the diagnostic.

Disable all

Disables this diagnostic for all data stores accessed by the model.

Enable all as warnings

Displays diagnostic as a warning at the MATLAB command line.

Enable all as errors

Halts the simulation and displays the diagnostic in an error dialog box.

    Note:   During model referencing simulation in Accelerator and Rapid Accelerator mode, if the Detect write after read parameter is set to Enable all as warnings, Enable all as errors, or Use local settings, Simulink temporarily changes the setting to Disable all.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration this parameter setting during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: WriteAfterReadMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' | 'EnableAllAsError'
Default: 'UseLocalSettings'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionEnable all as errors

See Also

Detect write after write

Select the diagnostic action to take if the model attempts to write data to a data store twice in succession in the current time step.

Settings

Default: Use local settings

Use local settings

For each local data store (defined by a Data Store Memory block or Simulink.Signal object in a model workspace) use the setting specified by the block. For each global data store (defined by a Simulink.Signal object in the base workspace) disable the diagnostic.

Disable all

Disables this diagnostic for all data stores accessed by the model.

Enable all as warnings

Displays diagnostic as a warning at the MATLAB command line.

Enable all as errors

Halts the simulation and displays the diagnostic in an error dialog box.

    Note:   During model referencing simulation in Accelerator and Rapid Accelerator mode, if the Detect write after write parameter is set to Enable all as warnings, Enable all as errors, or Use local settings, Simulink temporarily changes the setting to Disable all.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration this parameter setting during accelerated simulation.

    1. In the Simulink Editor, select Analysis > Model Advisor.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

Parameter: WriteAfterWriteMsg
Type: string
Value: 'UseLocalSettings' | 'DisableAll' | 'EnableAllAsWarning' | 'EnableAllAsError'
Default: 'UseLocalSettings'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionEnable all as errors

See Also

Multitask data store

Select the diagnostic action to take when one task reads data from a Data Store Memory block to which another task writes data.

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'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Duplicate data store names

Select the diagnostic action to take when the model contains multiple data stores that have the same name. The data stores can be defined with Data Store Memory blocks or Simulink.Signal objects.

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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Was this topic helpful?