Main Content

get

Get property of AUTOSAR element

Description

pValue = get(arProps,elementPath,property) returns the value of the specified property of the AUTOSAR element at elementPath.

example

Examples

collapse all

For a model, get the value of the IsService property for the sender-receiver interface Interface1. The variable IsService returns false (0), indicating that the sender-receiver interface is not a service.

hModel = 'autosar_swc_expfcns';
openExample(hModel);
arProps = autosar.api.getAUTOSARProperties(hModel);
isService = get(arProps,'Interface1','IsService')
isService =
  logical
   0

For an AUTOSAR model, to prepare for setting the symbol property for runnable Runnable1 to test_symbol, get the AUTOSAR component qualified name and the existing runnable symbol name.

hModel = 'autosar_swc_expfcns';
openExample(hModel);
arProps = autosar.api.getAUTOSARProperties(hModel);
compQName = get(arProps,'XmlOptions','ComponentQualifiedName');
runnables = find(arProps,compQName,'Runnable','PathType','FullyQualified');
runnables(2)
ans =
  1×1 cell array
    {'/pkg/swc/ASWC/IB/Runnable1'}
get(arProps,runnables{2},'symbol')
ans =
    'Runnable1'
set(arProps,runnables{2},'symbol','test_symbol')
get(arProps,runnables{2},'symbol')
ans =
    'test_symbol'

Input Arguments

collapse all

AUTOSAR properties information for a model, previously returned by arProps = autosar.api.getAUTOSARProperties(model). model is a handle, character vector, or string scalar representing the model name.

Example: arProps

Path to the AUTOSAR element for which to return the value of a property.

Example: 'Input'

Property for which to return a value, among valid properties of the AUTOSAR element.

Example: 'IsService'

Output Arguments

collapse all

Variable that returns the value of the specified AUTOSAR property. For composite properties or properties that reference other properties, the return value is the path to the property.

Example: ifPaths

Version History

Introduced in R2013b