How to add AUTOSAR Parameter programmatically to the AUTOSAR dictionary, and get its properties?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 23 Okt. 2019
Beantwortet: MathWorks Support Team
am 23 Okt. 2019
How to add AUTOSAR Parameter programmatically to the AUTOSAR dictionary, and get its properties?
Akzeptierte Antwort
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');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu AUTOSAR Blockset finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!