Provide More Design Range Information
This example shows that if the analysis cannot derive range information because there is insufficient design range information, you can fix the issue by providing additional design range information.
Open Model
Open the ex_derived_min_max_5
model.
open_system("ex_derived_min_max_5.slx")
The model displays the specified design minimum and maximum values for the blocks in the model.
The Inport block
In1
has a design range of[-10..20]
.The rest of the blocks in the model have no specified design range.
To display design ranges in your model, in the Debug tab, select Information Overlays > Signal Data Ranges.
Collect Ranges in the Fixed-Point Tool
From the Simulink® Apps tab, select Fixed-Point Tool.
In the Fixed-Point Tool, under New workflow, select
Iterative Fixed-Point Conversion
.In the Fixed-Point Tool, under System Under Design (SUD), select
ex_derived_min_max_5
as the system you want to convert.Under Range Collection Mode, select Derived ranges.
Click the Collect Ranges button.
When the analysis is complete, the Fixed-Point Tool displays the derived minimum and maximum values for the blocks in the model in the spreadsheet. Because the model contains a feedback loop, the analysis is unable to derive an output range for the Add block or for any of the blocks connected to this output.
To fix the issue, specify design minimum and maximum values inside the feedback loop. For this example, specify the range for the
Gain2
block:In the model, double-click the
Gain2
block.In the block parameters dialog box, select the Signal Attributes tab.
In this tab, set Output minimum to
-20
and Output maximum to40
and click OK.
Clear previously collected ranges and rerun the range analysis.
In the Fixed-Point Tool, under New workflow, select
Range Collection
.Changing workflows clears range data collected during the active workflow.
Switch back to the
Iterative Fixed-Point Conversion
workflow.Select Derived ranges as the range collection mode.
Click the Collect Ranges button again to rerun the range analysis.
The range analysis uses the minimum and maximum values specified for
Gain2
andIn1
to derive ranges for all objects in the model.
Provide Additional Design Range Information
To fix the issue, specify design minimum and maximum values inside the feedback loop. For this example, specify the range for the
Gain2
block:In the model, double-click the
Gain2
block.In the block parameters dialog box, select the Signal Attributes tab.
In this tab, set Output minimum to
-20
and Output maximum to40
and click OK.
Clear previously collected ranges and rerun the range analysis.
In the Fixed-Point Tool, under New workflow, select
Range Collection
.Changing workflows clears range data collected during the active workflow.
Switch back to the
Iterative Fixed-Point Conversion
workflow.Select Derived ranges as the range collection mode.
Click the Collect Ranges button again to rerun the range analysis.
The range analysis uses the minimum and maximum values specified for
Gain2
andIn1
to derive ranges for all objects in the model.