AUTOSAR internal calibration parameters are internal to an AUTOSAR software component,
and are accessed only by instances of the software component in which they are defined.
You can use AUTOSAR.Parameter
data objects to configure internal
calibration parameters in Simulink®. After creating and configuring the parameter data objects, you reference
them from block parameters in your model.
To configure AUTOSAR calibration parameters that can be accessed by other AUTOSAR software components, see Configure AUTOSAR Calibration Component.
To configure an AUTOSAR internal calibration parameter:
Set the value of a block parameter in your model to reference the name of the
calibration parameter. For example, open the example model
autosar_swc_counter
.
Open the Model Data Editor (on the
AUTOSAR tab, select Settings > Model Data Editor) and select the Parameters tab. Change the
value of the Constant block from LIMIT
to
myPrm
.
Create an AUTOSAR.Parameter
data object for the calibration
parameter. While editing the parameter value in the Model Data Editor, click the
action button next to
myPrm
and select
Create.
In the Create New Data dialog box,
Value field, enter AUTOSAR.Parameter
.
If you set Location to Base
Workspace
, you can set a storage class in the
AUTOSAR.Parameter
dialog box . To map a
Simulink lookup table to the parameter, you use the mapLookupTable
function.
If you set Location to Model
Workspace
, you cannot set a storage class in the
AUTOSAR.Parameter
dialog box . However, to
map a Simulink lookup table to the parameter, you can use the Code
Mappings editor, Parameters tab, or the
mapParameter
function.
This example sets Location to Base
Workspace
. Click Create. An AUTOSAR.Parameter
object
appears.
In the AUTOSAR.Parameter
property dialog box, configure
these properties:
Value — Specify a value for the calibration parameter. For an internal calibration parameter, this value represents the initial value.
Data type — Specify a data type for the calibration parameter. For more information, see Specify Data Types Using Data Type Assistant.
Storage class — For a base workspace
parameter, to specify an internal calibration parameter, from the
drop-down list, select InternalCalPrm
. To
specify Per instance behavior, select one of the
following:
Parameter shared by
all instances of the Software
Component
Each instance of the Software Component has its
own copy of the parameter
In the Configuration Parameters dialog box, in the Code Generation > Interface pane, clear the option Ignore custom storage classes, if it is not already cleared.
To map a Simulink lookup table to the base workspace parameter
myPrm
, use the mapLookupTable
function.
Generate code.
Note
The software does not support the use of AUTOSAR calibration parameters within Model blocks.