Contents

Best Practices for Fixed-Point Workflow

Use a Known Working Simulink Model

Before you begin automatic data typing, verify that update diagram succeeds for your model. To update diagram, press Ctrl+D. If update diagram fails, before automatic data typing to propose data types, fix the failure in your model.

Back Up Your Simulink Model

Before using the Fixed-Point Tool, back up your Simulink® model and associated workspace variables.

Backing up your model provides a backup of your original model in case of error and a baseline for testing and validation.

Capture the Current Data Type Override Settings

Before changing the current fixed-point instrumentation and data type override settings, use the Fixed-Point Tool Shortcut Editor to create a shortcut for these settings. Creating a shortcut allows you to revert to the original model settings. For more information, see Capture Model Settings Using the Shortcut Editor.

Convert Individual Subsystems

Convert individual subsystems in your model one at a time. This practice facilitates debugging by isolating the source of fixed-point issues. For example, see Debug a Fixed-Point Model.

Isolate the System Under Conversion

If you encounter data type propagation issues with a particular subsystem during the conversion, 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 automatic data typing for the rest of your model.

Do Not Use "Save as" on Referenced Models and MATLAB Function blocks

During the fixed-point conversion process using the Fixed-Point Tool, do not use the "Save as" option to save referenced models or MATLAB® Function blocks with a different name. If you do, you might lose existing results for the original model.

Use Lock Output Data Type Setting

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

  • You already know the fixed-point data types that you want to use for a particular block.

    For example, the block is modeling a real-world component. Set up the block to allow for known hardware limitations, such as restricting outputs to integer values.

    Explicitly specify the output data type of the block and select Lock output data type setting against changes by the fixed-point tools.

  • You are debugging a model and know that a particular block accepts only certain input signal data types.

    Explicitly specify the output data type of upstream blocks and select Lock output data type setting against changes by the fixed-point tools.

Save Simulink Signal Objects

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

Test Update Diagram Failure

Immediately after applying data type proposals, test update diagram. If update diagram fails, perform one of the following actions:

  • Use the failure information to fix the errors in your model. After fixing the errors, test update diagram again.

  • If you are unable to fix the errors, restore your back-up model. After restoring the model, try to fix the errors by, for example, locking output data type settings and isolating the system, as described in the preceding sections. After addressing the errors, test update diagram again.

Disable Fast Restart

The Fixed-Point Tool provides limited support when the model is simulated in Fast Restart. You must disable Fast Restart to collect simulation and derived ranges, and propose data types.

Was this topic helpful?