How to Use createEnumeration with externally defined enumeration data type?
Show older comments
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 Comment
Thomas Jensen
on 15 Apr 2021
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,
Answers (0)
Categories
Find more on AUTOSAR Blockset in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!