mapDataStore
Map Simulink data store to AUTOSAR variable
Syntax
Description
mapDataStore(
maps Simulink® data store memory block slMap
,slBlockHandle
,arVarType
)slBlockHandle
to an
AUTOSAR variable of type arVarType
for AUTOSAR run-time
calibration. AUTOSAR variable types include
ArTypedPerInstanceMemory
and StaticMemory
for classic models and Persistency
for adaptive models.
mapDataStore(
specifies additional properties for an AUTOSAR
slMap
,slBlockHandle
,arVarType
,Name,Value
)ArTypedPerInstanceMemory
, StaticMemory
, or
Persistency
variable by using one or more
Name,Value
pair arguments.
Examples
Set AUTOSAR Mapping Information for Simulink Data Stores
Set AUTOSAR mapping and property information for the
Simulink data store memory block Data Store Memory
in
example model autosar_bsw_sensor1
.
hModel = 'autosar_bsw_sensor1'; hBlock = 'autosar_bsw_sensor1/Data Store Memory'; openExample(hModel); slMap = autosar.api.getSimulinkMapping(hModel); mapDataStore(slMap,hBlock,'ArTypedPerInstanceMemory','NeedsNVRAMAccess','true'); arMappedTo = getDataStore(slMap,hBlock) arNvram = getDataStore(slMap,hBlock,'NeedsNVRAMAccess')
arMappedTo = 'ArTypedPerInstanceMemory' arNvram = 'true'
Input Arguments
slMap
— Simulink to AUTOSAR mapping information for a model
handle
Simulink to AUTOSAR mapping information for a model, previously
returned by
.
slMap
=
autosar.api.getSimulinkMapping(model
)
is a handle,
character vector, or string scalar representing the model name.model
Example: slMap
slBlockHandle
— Simulink data store memory block handle
handle
Name or handle of Simulink data store memory block that you set AUTOSAR mapping information for.
Example: 'autosar_bsw_sensor1/Data Store
Memory'
arVarType
— Type of AUTOSAR variable
character vector | string scalar
Type of AUTOSAR variable that you want to map the specified Simulink data store to. Valid AUTOSAR variable types include
ArTypedPerInstanceMemory
,
StaticMemory
, and Auto
for classic
models. Valid AUTOSAR variable types include Persistency
and Auto
for adaptive models. To accept software mapping
defaults, specify Auto
.
Example: 'StaticMemory'
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'SwCalibrationAccess','ReadWrite'
specifies read-write
access to the variable for run-time calibration.
DataElement
— Parameter interface data element (Persistency
only)
character vector | string scalar
Specify the data element of the persistency port associated with the
AUTOSAR adaptive variable. DataElement
can be set
with Port
only.
Example: 'Port','Perport','DataElement','Delement1'
DisplayFormat
— Calibration display format
character vector | string scalar
Specify display format for the AUTOSAR variable. AUTOSAR display format specifications control the width and precision display for calibration and measurement data. For more information, see Configure DisplayFormat.
Example: 'DisplayFormat','%2.6f'
IsVolatile
— C volatile
type qualifier flag (StaticMemory
only)
character vector | string scalar
Specify whether to include C type qualifier
volatile
in generated code for the AUTOSAR
variable.
Example: 'IsVolatile','true'
NeedsNVRAMAccess
— NeedsNVRAMAccess
flag
(ArTypedPerInstanceMemory
only)
character vector | string scalar
Specify whether the AUTOSAR variable requires access to nonvolatile
RAM on a processor. Specify true
to configure the
per-instance memory to be a mirror block for a specific NVRAM block.
Specify RestoreAtStart
to true
to
read data from memory at the beginning of a program. Specify
StoreAtShutdown
to true
to
write data to memory at the end of a program.
Example: 'NeedsNVRAMAccess','true', 'RestoreAtStart', 'true',
'StoreAtShutdown', 'true'
Port
— Parameter receiver port (Persistency
only)
character vector | string scalar
Specify the persistency port to associate with the AUTOSAR adaptive
variable. Port
can be set with
DataElement
only.
Example: 'Port','Perport','DataElement','Delement1'
Qualifier
— C AdditionalNativeTypeQualifier
flag (StaticMemory
only)
character vector | string scalar
Optionally specify an AUTOSAR additional native type qualifier to include in generated code for the AUTOSAR variable.
Example: 'Qualifier','test_qualifier'
ShortName
— Variable short name
character vector | string scalar
Specify short name for the AUTOSAR variable. If unspecified, ARXML export automatically generates a short name, which can differ from the data store name.
Example: 'ShortName','LowSetPoint'
SwAddrMethod
— Name of variable SwAddrMethod
character vector | string scalar
Specify a SwAddrMethod
name that is valid for the
AUTOSAR variable. Code generation uses the
SwAddrMethod
name to group AUTOSAR variables in a
memory section for access by calibration and measurement tools. For a
list of valid SwAddrMethod
values for the variable,
see the Code Mappings editor, Data Stores tab. For
more information, see Configure SwAddrMethod.
Example: 'SwAddrMethod','VAR'
SwCalibrationAccess
— Calibration access mode
character vector | string scalar
Specify how calibration and measurement tools can access the AUTOSAR
variable. Valid access values include
ReadOnly
,
ReadWrite
, and
NotAccessible
. For more information, see
Configure SwCalibrationAccess.
Example: 'SwCalibrationAccess','ReadWrite'
LongName
— Variable long name
character vector | string scalar
Specify a headline for the AUTOSAR variable.
Example: 'LongName','Position of Engine
Throttle'
Version History
Introduced in R2019a
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)