How to Use createEnumeration with externally defined enumeration data type?

4 次查看(过去 30 天)
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 个评论
Thomas Jensen
Thomas Jensen 2021-4-15
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 个)

类别

Help CenterFile Exchange 中查找有关 AUTOSAR Blockset 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by