How to add AUTOSAR Parameter programmatically to the AUTOSAR dictionary, and get its properties?

10 Ansichten (letzte 30 Tage)

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 24 Okt. 2019
You can refer to these examples of working with the API:
Parameters are part of the ApplicationComponentBehavior (i.e. grouped under the "Behavior" element), so getting, editing, or adding those would be basically the same as any of the other ApplicationComponentBehavior property like IRVs.
Based on thee IRV example from the documentation, you can try this code:
% Open model
hModel = 'autosar_swc_expfcns';
open_system(hModel);
% Use AUTOSAR property functions
arProps = autosar.api.getAUTOSARProperties(hModel);
% Get AUTOSAR internal behavior
swc = get(arProps,'XmlOptions','ComponentQualifiedName');
ib = get(arProps,swc,'Behavior');
% add Parameter
swCalibValue = 'ReadWrite';
add(arProps,ib,'Parameters','myparam','SwCalibrationAccess',swCalibValue);
% get Parameters and properties
params = get(arProps,ib,'Parameters');
get(arProps,params{1},'SwCalibrationAccess');
get(arProps,params{1},'SwAddrMethod');

Weitere Antworten (0)

Kategorien

Mehr zu AUTOSAR Blockset finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by