Products & Services Industries Academia Support User Community Company

Learn more about Simulink   

fxptdlg - Invoke Fixed-Point Tool

Syntax

fxptdlg('modelname')

Description

fxptdlg('modelname') launches the Fixed-Point Tool for the Simulink model specified by modelname. You can also access this tool by the following methods:

In conjunction with Simulink Fixed Point software, the Fixed-Point Tool provides convenient access to:

You can launch the Fixed-Point Tool for any system or subsystem, and the tool controls the object selected in its Model Hierarchy pane. If Simulink Fixed Point software is installed, the Fixed-Point Tool Contents pane displays the name, data type, design minimum and maximum values, minimum and maximum simulation values, and scaling of each model object that logs fixed-point data. Additionally, if a signal saturates or overflows, the tool displays the number of times saturation or overflow occurred. You can display an object's dialog box by right-clicking the appropriate entry in the Contents pane and selecting Properties.

Most of the functionality in the Fixed-Point Tool is for use with the Simulink Fixed Point software. However, even if you do not have Simulink Fixed Point software, you can use data type override to simulate a model that specifies fixed-point data types. In this mode, the Simulink software replaces fixed-point data types with floating-point data types when simulating the model. Data type override mode allows you to share fixed-point models with people in your company who do not have Simulink Fixed Point software.

To simulate a model without using Simulink Fixed Point:

  1. From the Simulink Tools menu, select Fixed-Point > Fixed-Point Tool.

    The Fixed-Point Tool appears.

  2. Set the Fixed-point instrumentation mode parameter to Force off.

  3. Set the Data type override parameter to True doubles or True singles.

Parameters and Dialog Box

The Fixed-Point Tool includes the following components:

Model Hierarchy Pane

The Model Hierarchy pane displays a tree-structured view of the Simulink model hierarchy. The first node in the pane represents a Simulink model. Expanding the root node displays subnodes that represent the model's subsystems, Embedded MATLAB Function blocks, Stateflow charts, and referenced models.

The Fixed-Point Tool's Contents pane displays elements that comprise the object selected in the Model Hierarchy pane. The Dialog pane provides parameters for specifying the selected object's data type override and fixed-point instrumentation mode. Objects that control the Fixed-point instrumentation mode parameter display a red flag on their icons, while those that control the Data type override parameter display a green flag. The Model Hierarchy pane indicates the value of these parameters by displaying the following abbreviations next to the object name:

AbbreviationParameter Value

Fixed-point instrumentation mode

    mmoMinimums, maximums and overflows
    oOverflows only
    foForce off

Data type override

    sclScaled doubles
    dblTrue doubles
    sglTrue singles
    foForce off

See Dialog Pane for more information about these parameters.

Contents Pane

The Contents pane displays a tabular view of objects that log fixed-point data in the system or subsystem selected in the Model Hierarchy pane. The table rows correspond to model objects, such as blocks, block parameters, and Stateflow data. The table columns correspond to attributes of those objects, such as the data type, design minimum and maximum values, and simulation minimum and maximum values.

The Contents pane displays columns that correspond to the following properties and controls:

Column LabelDescription

Name

Identifies path and name of block.

Run

Indicates whether the Fixed-Point Tool stores results as an active or a reference run.

SimDT

Data type the block uses during simulation.

SpecifiedDT

Data type the block specifies in its parameter dialog box, for example, the value of its Output data type parameter.

ProposedDT

Data type that the Fixed-Point Tool proposes.

Accept

Check box that enables you to selectively accept the Fixed-Point Tool's scaling proposal.

DesignMin

Minimum value the block specifies in its parameter dialog box, for example, the value of its Output minimum parameter.

SimMin

Minimum value that occurs during simulation.

ProposedMin

Minimum value that results from the data type the Fixed-Point Tool proposes.

DesignMax

Maximum value the block specifies in its parameter dialog box, for example, the value of its Output maximum parameter.

SimMax

Maximum value that occurs during simulation.

ProposedMax

Maximum value that results from the data type the Fixed-Point Tool proposes.

OverflowWraps

Number of overflows that wrap during simulation.

Saturations

Number of overflows that saturate during simulation.

DTGroup

Identification tag associated with objects that share data types.

DivByZero

Number of divide-by-zero instances that occur during simulation.

LogSignal

Check box that allows you to enable or disable signal logging for an object.

InitValueMin

Minimum initial value for a signal or parameter. Some model objects provide parameters that allow you to specify the initial values of their signals. For example, the Constant block includes a Constant value that initializes the block output signal.

    Note   The Fixed-Point Tool uses this parameter when it proposes scaling.

InitValueMax

Maximum initial value for a signal or parameter. Some model objects provide parameters that allow you to specify the initial values of their signals. For example, the Constant block includes a Constant value that initializes the block output signal.

    Note   The Fixed-Point Tool uses this parameter when it proposes scaling.

ModelRequiredMin

Minimum value of a parameter used during simulation. For example, the Lookup Table (n-D) uses the Breakpoints and Table data parameters to perform its lookup operation and generate output. In this example, the block uses more than one parameter so the Fixed-Point Tool sets ModelRequiredMin to the minimum of the minimum values of all these parameters.

    Note   The Fixed-Point Tool uses this parameter when it proposes scaling.

ModelRequiredMax

Maximum value of a parameter used during simulation. For example, the Lookup Table (n-D) uses the Breakpoints and Table data parameters to perform its lookup operation and generate output. In this example, the block uses more than one parameter so the Fixed-Point Tool sets ModelRequiredMax to the maximum of the maximum values of all these parameters.

    Note   The Fixed-Point Tool uses this parameter when it proposes scaling.

The following topics describe ways in which you can customize the Contents pane:

Changing Column Order and Width

You can alter the order and width of columns that appear in the Contents pane as follows:

Sorting Rows by Column

By default, the Contents pane displays its contents in ascending order of the Name column. You can alter the order in which the Contents pane displays its rows as follows:

Hiding Columns

You can select the properties that the Contents pane displays or hides by using the Customize Contents pane. When visible, the pane appears in the lower-left corner of the Fixed-Point Tool window.

Dialog Pane

Use the Dialog pane to view and change properties associated with the object selected in the Model Hierarchy pane.

Tips

From the Fixed-Point Tool View menu, you can select Dialog View to hide the Dialog pane, making more room for displaying results.

Propose fraction lengths

Collect range data and proposes fraction lengths for model objects.

Action

Use this button to perform the first phase of the autoscaling procedure, in which the Fixed-Point Tool collects range data for model objects—either from design minimum and maximum values the objects specify explicitly, or from logged minimum and maximum values that occur during simulation. Based on these values, the tool proposes fraction lengths for blocks whose:

The Fixed-Point Tool lists its scaling proposals in the Contents pane. The tool alerts you to potential scaling issues for each object in the list by displaying a green, yellow, or red icon, as shown here:

The proposed scaling poses no issues for this object.

The proposed scaling poses potential issues for this object. Open the Autoscale Information dialog box to review these issues.

The proposed scaling will introduce data type errors if applied to this object. Open the Autoscale Information dialog box for details about how to resolve these issues.

Command-Line Alternative

No command line alternative available.

Apply accepted fraction lengths

Apply scaling proposals.

Action

Use this button to perform the second phase of the autoscaling procedure, in which the Fixed-Point Tool applies the scaling proposals to the objects whose Accept check box in the Contents pane is selected.

Command-Line Alternative

No command line alternative available.

Use simulation min/max if design min/max are not available

Propose fraction lengths based on simulation minimum and maximum values if no design minimum and maximum values are available.

Settings

Default: On

On

Proposes fraction lengths based on simulation minimum and maximum values, but only for blocks that do not specify design minimum or maximum values using, for example, Output minimum and Output maximum parameters.

Off

Ignores simulation minimum and maximum values when proposing fraction lengths.

Dependency

This parameter enables Percent safety margin for simulation min/max.

Command-Line Alternative

No command line alternative available.

Percent safety margin for simulation min/max

Specify multiplication safety factor for simulation minimum and maximum values.

Settings

Default: 0

The simulation minimum and maximum values are multiplied by the factor designated by this parameter, allowing you to specify a range different from that obtained from the simulation run. For example, a value of 55 specifies that a range at least 55 percent larger is desired. A value of -15 specifies that a range up to 15 percent smaller is acceptable.

Dependencies

This parameter is enabled by Use simulation min/max if design min/max are not available.

Before performing autoscaling, you must either specify design minimum and maximum values or run a simulation to collect simulation minimum and maximum data.

Command-Line Alternative

No command line alternative available.

Percent safety margin for design min/max

Specify multiplication safety factor for design minimum and maximum values.

Settings

Default: 0

The design minimum and maximum values are multiplied by the factor designated by this parameter. For example, a value of 55 specifies that a range at least 55 percent larger is desired. A value of -15 specifies that a range up to 15 percent smaller is acceptable.

Dependency

Before performing autoscaling, you must either specify design minimum and maximum values or run a simulation to collect simulation minimum and maximum data.

Command-Line Alternative

No command line alternative available.

Show autoscale information for selected result

Display the Autoscale Information dialog box for object selected in the Contents pane.

Action

Use this option to:

Command-Line Alternative

No command line alternative available.

Exchange Active and Reference results

Swap results between active and reference run.

Action

Use this button to swap the results that the Fixed-Point Tool stores as an active run with those that it stores as a reference run.

Command-Line Alternative

No command-line alternative available.

Run simulation and store Active results

Simulate model and store results.

Action

Simulates the model and stores the results as active run, denoted by the Active label in the Run column of the Contents pane.

Tips

Using the Run simulation and store Active results button is the same as simulating the model using the Start simulation button in the Model Editor.

Command-Line Alternative

Command: sim

Fixed-point instrumentation mode

Control which objects log minimum, maximum and overflow data during simulation.

Settings

Default: Use local settings

Use local settings

Logs data according to the value of this parameter set for each subsystem. Otherwise, settings for parent systems always override those of child systems.

Minimums, maximums and overflows

Logs minimum value, maximum value, and overflow data for all blocks in the current system or subsystem during simulation.

Overflows only

Logs only overflow data for all blocks in the current system or subsystem.

Force off

Does not log data for any block in the current system or subsystem. Use this selection to work with models containing fixed-point enabled blocks if you do not have a Simulink Fixed Point license.

Tips

Dependencies

The value of this parameter for parent systems controls min/max logging for all child subsystems, unless Use local settings is selected.

Command-Line Alternative

Parameter: 'MinMaxOverflowLogging'
Type: string
Value: 'UseLocalSettings' | 'MinMaxAndOverflow' | 'OverflowOnly' | 'ForceOff'
Default: 'UseLocalSettings'

Data type override

Control data type override of objects that allow you to specify data types in their dialog boxes.

Settings

Default: Use local settings

The value of this parameter for parent systems controls data type override for all child subsystems, unless Use local settings is selected.

Use local settings

Overrides data types according to the setting of this parameter for each subsystem. Otherwise, settings for parent systems override those of child systems.

Scaled doubles

Overrides the output data type of all blocks in the current system or subsystem with doubles; however, the scaling and bias specified in the mask of each block is maintained.

True doubles

Overrides the output data type of all blocks in the current system or subsystem with double-precision. The overridden values have no scaling or bias.

True singles

Overrides the output data type of all blocks in the current system or subsystem with single-precision. The overridden values have no scaling or bias.

Force off

No data type override is performed on any block in the current system or subsystem.

Tips

Dependencies

Command-Line Alternative

Parameter: 'DataTypeOverride'
Type: string
Value: 'UseLocalSettings' | 'ScaledDoubles' | 'TrueDoubles' | 'TrueSingles' | 'ForceOff'
Default: 'UseLocalSettings'

Overwrite or merge model simulation results

Control how simulation results are stored.

Settings

Default: Overwrite

Overwrite

Clears all existing active simulation results before displaying new simulation results.

Merge

Merges new simulation results with existing simulation results in the active run. Allows you to collect complete range information from multiple test benches.

Command-Line Alternative

Parameter: 'MinMaxOverflowArchiveMode'
Type: string
Value: 'Overwrite' | 'Merge'
Default: 'Overwrite'

Tip

Set this parameter to Merge to log simulation minimum and maximum values captured over multiple simulations.

Main Toolbar

The Fixed-Point Tool's main toolbar appears near the top of the Fixed-Point Tool window under the Fixed-Point Tool's menu.

The toolbar contains the following buttons that execute commonly used Fixed-Point Tool commands:

ButtonUsage

Propose fraction lengths.

Apply accepted fraction lengths.

Display autoscale information.

Exchange active results with reference results.

Simulate a model and store results as active run.

Pause a simulation.

Stop a simulation.

Create a time series plot.

Create a histogram plot.

Create a time series difference (A-R) plot.

The toolbar also contains the Show option:

The Show option specifies the type of results to display in the Contents pane. The Contents pane displays information only after you simulate a system or propose fraction lengths. If there are no results that satisfy a particular filter option, the list will be blank.

Options include:

Plot Interface

The Fixed-Point Tool provides plotting capabilities that enable you to plot signals for graphical analysis. The tool can access signal data that resides in the MATLAB workspace, allowing you to plot simulation results associated with:

The toolbar contains tools for interactive zooming, panning, rotating, querying, and editing plots. For more information, see Figure Toolbars in the MATLAB documentation.

You can create the following types of plots using the Fixed-Point Tool's interface:

Time Series Plot

Plots data as a function of time.

Histogram Plot

Helps you visualize the dynamic range of a signal.

This plot provides information about the:

You can use this information to estimate the word size needed to represent the signal.

Time Series Difference (A-R) Plot

Plots both the active and reference versions of a signal on the upper axes, and plots the difference between the active and reference versions of that signal on the lower axes. For more details, see Tutorial: Feedback Controller in the Simulink Fixed Point documentation.

This plot also provides details of the real world value of the signal on the left y-axis, and the corresponding integer value on the right y-axis. If the Fixed-Point Tool cannot determine the scaling for a fixed-point data type, it cannot display the integer value information. In this case, it labels the right y-axis Integer Value Indeterminate. For more information on scaling, see Scaling in the Simulink Fixed Point documentation.

Synchronized Zooming on the Time Series Difference (A-R) Plot

By default, synchronized zooming is enabled for the Time Series Difference (A-R) plot. If you zoom in or out on a selected area on one plot, only the x-axis zooms on the other plot. To return to the original view at any time:

  1. Right-click on either plot to open the context menu

  2. Select Reset to Original View

Signal Logging Options

The Fixed-Point Tool provides options that allow you to control signal logging in a model (see Logging Signals). Using these options, you can enable or disable logging for multiple signals simultaneously, based on signal attributes such as:

The Fixed-Point Tool does not control signal logging for referenced models or subsystems with library links. It ignores these objects when enabling or disabling signal logging in a model hierarchy.

You can control the signal logging of a Simulink subsystem, that is placed inside of a Stateflow Chart, from the subsystem parent node.

How to Access the Signal Logging Options in the Fixed-Point Tool

  1. In the Model Hierarchy pane, right-click a node that represents either a model or a subsystem.

    The Fixed-Point Tool displays a context menu for the selected node.

  2. In the context menu, select either Enable Signal Logging or Disable Signal Logging.

    The Fixed-Point Tool displays a submenu that lists a variety of signal logging options.

Signal Logging Options

Choose from the following signal logging options:

Select...

To Enable or Disable Signal Logging for...

All Signals in this System

All signals in the selected system

All Signals from Here Down

All signals in the selected system and its subsystems

Outports in this System

All Outport blocks in the selected system

Named Signals in this System

All signals in the selected system, whose Signal name parameter specifies a value

Named Signals from Here Down

All signals in the selected system and its subsystems, whose Signal name parameter specifies a value

Unnamed Signals in this System

All signals in the selected system, whose Signal name parameter is empty

Unnamed Signals from Here Down

All signals in the selected system and its subsystems, whose Signal name parameter is empty

Examples

To learn how to use the tool, see Tutorial: Feedback Controller in the Simulink Fixed Point documentation.

See Also

autofixexp in the Simulink Fixed Point documentation.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS