Main Content

getDataStore

Get AUTOSAR mapping information for Simulink data store

Description

example

arValue = getDataStore(slMap,slBlockHandle)returns the type of AUTOSAR variable mapped to Simulink® data store memory block slBlockHandle. AUTOSAR variable types include ArTypedPerInstanceMemory and StaticMemory for classic models and Persistency for adaptive models.

arValue = getDataStore(slMap,slBlockHandle,arProperty) returns the value of property arProperty for the AUTOSAR variable that the Simulink data store is mapped to.

Examples

collapse all

Get 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';
addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));
hBlock = 'autosar_bsw_sensor1/Data Store Memory';

open_system(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

collapse all

Simulink to AUTOSAR mapping information for a model, previously returned by slMap = autosar.api.getSimulinkMapping(model). model is a handle, character vector, or string scalar representing the model name.

Example: slMap

Name or handle of Simulink data store memory block for which to return AUTOSAR mapping information.

Example: 'autosar_bsw_sensor1/Data Store Memory'

Name of AUTOSAR variable property.

For AUTOSAR classic models, valid property names include ShortName, SwAddrMethod, SwCalibrationAccess, and DisplayFormat. For ArTypedPerInstancememory, you can specify NeedsNVRAMAccess. For StaticMemory, you can specify C type qualifier properties IsVolatile or Qualifier (AUTOSAR additional native type qualifier).

For AUTOSAR adaptive models, valid property names include Port and DataElement.

For property descriptions, see mapDataStore.

Example: 'SwCalibrationAccess'

Output Arguments

collapse all

Variable that returns either the type of the mapped AUTOSAR variable or the value of a variable property.

Example: arValue

Introduced in R2019a