generated code from multiple model by using model referencing how to integrate in BSW

4 visualizzazioni (ultimi 30 giorni)
we are generated code from multiple model by using model referencing . how to integrate that code to BSW and I want single output from both .slx files.

Risposta accettata

Purvaja
Purvaja il 2 Mag 2025
Modificato: Purvaja il 2 Mag 2025
Hey Shital,
Understanding from your question, you want a single output from referenced models.
You can do this by making a parent model where you call these both models.
And then generate the C/C++ code using Simulink or Embedded Coder. Ensure that you have adjusted solver settings to generate code. You may refer to the below example:
I constructed two models and referenced them in a single “ParentModel Simulink model using “Model” block as:
On this single ‘ParentModel.slx’ use Simulink Coder or Embedded Coder to generate code. Before generating adjust the settings to generate single input and output endpoints.
Refer to the below links to Integrate the code in BSW:
  1. Model AUTOSAR Basic Software Service Calls: https://www.mathworks.com/help/autosar/ug/model-autosar-basic-software-bsw-service-calls.html
  2. AUTOSAR Blockset: https://www.mathworks.com/help/autosar/index.html
For more clarification on model referencing and code generation, refer to the following links:
  1. Model referencing: https://www.mathworks.com/help/simulink/model-reference.html
  2. Generate Code for Model Reference Hierarchy: https://www.mathworks.com/help/rtw/ug/generate-code-for-model-reference-hierarchy.html
  3. Combined Code generated for models: https://www.mathworks.com/help/rtw/ug/combined-models.html
For documentation specific links, access them using following commands in MATLAB command window respectively:
web(fullfile(docroot, '/autosar/ug/model-autosar-basic-software-bsw-service-calls.html'))
web(fullfile(docroot, '/autosar/index.html'))
web(fullfile(docroot, '/simulink/model-reference.html'))
web(fullfile(docroot, '/rtw/ug/generate-code-for-model-reference-hierarchy.html'))
web(fullfile(docroot, '/rtw/ug/combined-models.html'))
I hope this helps you. Do share more details if you have more doubts regarding this.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by