Main Content

Import AUTOSAR Software Component with Multiple Runnables

The AUTOSAR ARXML importer functions createComponentAsModel and createCompositionAsModel and the AUTOSAR architecture function importFromARXML can import AUTOSAR software components with multiple runnable entities into a new Simulink® model. Use the 'ModelPeriodicRunnablesAs' argument on the model creation to specify whether the importer models AUTOSAR periodic runnables as atomic subsystems with periodic rates (the default) or function-call subsystems with periodic rates.

If you set 'ModelPeriodicRunnablesAs' to the default value, 'AtomicSubsystem', the importer creates rate-based models. If the ARXML code contains periodic runnables, the importer adds rate-based model content, including atomic subsystems and data transfer lines with rate transitions, and maps them to corresponding periodic runnables and IRVs imported from the AUTOSAR software component.

If you set 'ModelPeriodicRunnablesAs' to 'FunctionCallSubsystem', the importer creates function-call-based models. The importer adds function-call subsystem or function blocks and signal lines and maps them to corresponding runnables and IRVs imported from the AUTOSAR software component.

Set 'ModelPeriodicRunnablesAs' to 'AtomicSubsystem' unless your design requires use of function-call subsystems. The following call directs the importer to import a multi-runnable AUTOSAR software component from an ARXML file and map it into a new rate-based model.

openExample('autosarblockset/ImportAUTOSARComponentToSimulinkExample',...
'supportingfile','ThrottlePositionControlComposition.arxml');
ar = arxml.importer('ThrottlePositionControlComposition.arxml')
createComponentAsModel(ar,'/Company/Components/Controller',...
  'ModelPeriodicRunnablesAs','AtomicSubsystem')

For more information, see Model AUTOSAR Software Components.

See Also

| |

Related Topics