Products & Services Industries Academia Support User Community Company

Overview of the Fixed-Point Tool

Introduction to the Fixed-Point Tool

The Fixed-Point Tool is a graphical user interface that automates the task of specifying scaling for fixed-point data types in a model. The tool collects range data for model objects, either from design minimum and maximum values that objects specify explicitly, or from logged minimum and maximum values that occur during simulation. Based on these values, the tool proposes fixed-point scaling that maximizes precision and covers the range. The tool allows you to review the scaling proposals and then apply them selectively to objects in your model.

Before Using the Fixed-Point Tool to Autoscale Your Simulink Model

Before using the Fixed-Point Tool to autoscale your Simulink model, consider how autoscaling affects your model:

Best Practices for Using the Fixed-Point Tool to Autoscale Your Simulink Model

Start with a Known Working Simulink Model

Check that update diagram succeeds for your model before you begin autoscaling. (To update diagram, press Ctrl+D.) If update diagram fails, fix the failure in your model so that update diagram is successful before autoscaling.

Back Up Your Simulink Model

Always back up your Simulink model before using the Fixed-Point Tool.

This practice provides a fallback in case of error and a baseline for testing and validation.

Start Small

Start small and convert individual subsystems in your model one at a time. This practice facilitates debugging by isolating the source of fixed-point issues.

Isolate the System Under Conversion

If you encounter data type propagation issues with a particular subsystem, isolate this subsystem by placing Data Type Conversion blocks on the inputs and outputs of the system. The Data Type Conversion block converts an input signal of any Simulink data type to the data type and scaling you specify for its Output data type parameter. This practice enables you to continue autoscaling the rest of your model.

Test Update Diagram Failure

Test update diagram immediately after applying autoscaling proposals. If update diagram fails, take one of the following actions:

Use Lock Output Data Type Setting When Necessary

You can prevent the Fixed-Point Tool replacing the current data type. Use the Lock output data type setting against changes by the fixed-point tools parameter available on many blocks. The default setting allows replacement. Use this setting when:

Save Simulink Signal Objects Before Closing Your Model

If your model contains Simulink signal objects and you accept proposed data types, the Fixed-Point Tool applies the changes to the signal objects automatically. However, the Fixed-Point Tool does not automatically save changes it makes to Simulink signal objects. To preserve changes, save the Simulink signal objects in your workspace and model before closing the model.

Models That Might Cause Data Type Propagation Errors

When the Fixed-Point Tool proposes changes to the data types in your model, it alerts you to potential scaling issues for objects in the model. If the Fixed-Point Tool alerts you to data type errors, you must diagnose the errors and fix the problems. For more information, see Examining Results to Resolve Conflicts.

The Fixed-Point Tool is not aware of all potential scaling issues. Therefore, even when the Fixed-Point Tool does not report any scaling issues, accepting the proposed data types might cause data type propagation errors. To ensure that you can recover your original data type settings, back up your model before using the Fixed-Point Tool. For more information about backing up your model and other best practices for using the Fixed-Point Tool, see Best Practices for Using the Fixed-Point Tool to Autoscale Your Simulink Model.

The following models are likely to cause data type propagation issues:

Model Uses...Fixed-Point Tool BehaviorData Type Propagation Issue
BusesNot aware of the minimum, maximum, data type, and initial value information for bus objects and does not include them in autoscaling.Fixed-Point Tool might propose data types that are inconsistent with the data types for the bus object or generate proposals that cause overflows.
Simulink parameter objectsDoes not consider any data type information for Simulink parameter objects and does not include them in autoscaling.Fixed-Point Tool might propose data types that are inconsistent with the data types for the parameter object or generate proposals that cause overflows.
User-defined S-functionsNot aware of the operation of user-defined S-functions.
  • The user-defined S-function only accepts certain input data types. The Fixed-Point Tool is not aware of this requirement and proposes a different data type upstream of the S-function. Update diagram fails on the model due to data type mismatch errors.

  • The user-defined S-function specifies certain output data types. The Fixed-Point Tool is not aware of this requirement and does not use it when autoscaling. Therefore it might propose data types that are inconsistent with the data types for the S-function or generate proposals that cause overflows.

User-defined masked subsystemsHas no knowledge of the masked subsystem workspace and therefore cannot take this subsystem into account when autoscaling. Fixed-Point Tool might propose data types that are inconsistent with the requirements of the masked subsystem, particularly if the subsystem uses mask initialization. The proposed data types might cause data type mismatch errors or overflows.
Linked subsystemsDoes not include linked subsystems in autoscaling.Data type mismatch errors might occur at the linked subsystem boundaries.
Embedded MATLAB Function blocksDoes not propose data types for Embedded MATLAB Function blocks.Fixed-Point Tool might propose data types that are inconsistent with the requirements of the Embedded MATLAB Function blocks. The proposed data types might cause data type mismatch errors or overflows.
Model referenceDoes not propose data types for referenced models.Data type propagation errors might occur at the referenced model's boundaries.

Opening the Fixed-Point Tool

Use any of the following methods to open the Fixed-Point Tool:

Alternatively, you can use the fxptdlg function to open the tool programmatically.

Understanding the Interface

When you first open the Fixed-Point Tool, it appears as shown here.

The Fixed-Point Tool contains the following components:

  


Related Products & Applications

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

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