Fixing Design Range Conflicts

This example shows how to fix design range conflicts. If you specify conflicting design minimum and maximum values in your model, the range analysis software reports an error. To fix this error, examine the design ranges specified in the model to identify inconsistent design specifications. Modify them to make them consistent. In this example, the output design range specified on the Outport block conflicts with the input design ranges specified on the Inport blocks.

  1. Open the ex_range_conflict model. At the MATLAB® command line, enter:

    addpath(fullfile(docroot,'toolbox','fixpoint','examples'))
    ex_range_conflict

    The model displays the specified design minimum and maximum values for the blocks in the model.

    • The Inport blocks In1 and In2 have a design range of [-1..1].

    • The Outport block Out1 has a design range of [10..20].

    Tip

    To display design ranges in your model, from the model menu select Display > Signals & Ports and select Design Ranges.

  2. From the Simulink® Analysis menu, select Data Type Design > Fixed-Point Tool.

  3. In the Fixed-Point Tool, in the Prepare System section of the toolstrip, under System under design, select ex_range_conflict as the system you want to convert.

  4. In the Collect Ranges section of the toolstrip, select Derived Ranges.

  5. Click the Collect Ranges button.

    The Fixed-Point Tool generates an error because the range analysis fails. It reports an error because the derived range for the Sum block, [-2..2] is outside the specified design range for the Outport block, [10..20].

  6. Close the error dialog box.

  7. To fix the conflict, change the design range on the Outport block to [-10..20] so that this range includes the derived range for the Sum block.

    1. In the model, double-click the Outport block.

    2. In the block parameters dialog box, click the Signal Attributes tab.

    3. On this tab, set Minimum to -10 and click OK.

  8. Click the Collect Ranges button to rerun the range analysis.

    The range analysis derives a minimum value of -2 and a maximum value of 2 for the Outport block.

Related Topics