How to Use createEnumeration with externally defined enumeration data type?

I have an AUTOSAR SWC and I have an interface with enumeration data type; ModeRequest. I want the generated ARXML to use this enumeration as a data type but not with the default path of the SWC. On the integration level of the whole SW, there is a compu method called CM_ModeRequest. and it's at path /DataTypes/CompuMethod. I want my SWC to use this compumethod and to refer to /DataTypes/ModeRequest for the data type.
my enumeration name is: ModeRequest
The compu method used for this type is CompuMethod
The path I want to refere to (external) is /DataTypes
I tried to use the function createEnumeration
dataObj = autosar.api.getAUTOSARProperties('MySWC');
createEnumeration(dataObj,'ModeRequest','/DataTypes/CompuMethods',...
'/DataTypes');
Also I tried
dataObj = autosar.api.getAUTOSARProperties('MySWC');
createEnumeration(dataObj,'ModeRequest','/DataTypes/CompuMethods/CM_ModeRequest',...
'/DataTypes');
but I get an error The specified qualified path "/DataTypes" is not a valid
ImplementationDataType path. To create Simulink Enumeration, provide a
valid path.
I also tried
dataObj = autosar.api.getAUTOSARProperties('FSM');
createEnumeration(dataObj,'ModeRequest','/DataTypes/CompuMethods/CM_ModeRequest',...
'/DataTypes/ModeRequest');
but I get the error The AUTOSAR element does not exist at
'/DataTypes/ModeRequest'.
I don't know what to do to refer to this externally defined data type
Thanks in advance

댓글 수: 1

Hi Mahmoud,
Have you tried to create an ARXML file with the definition of the enumeration and import it as it described in https://nl.mathworks.com/help/autosar/ref/arxml.importer.updateautosarproperties.html?
I have never tried to do it, but I this that might work.
Best regards,

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

질문:

2021년 3월 12일

댓글:

2021년 4월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by