Error while generating AUTOSAR code from the model

조회 수: 6 (최근 30일)
Tejas
Tejas 2023년 7월 12일
댓글: Tejas 2023년 7월 13일
  • Exported Function 'MainModel/Input' has a periodic rate but it is not associated with a timing event in its mapped runnable 'Input'. The 'Sample time' of block 'MAinModel/Input' must be set to -1.
I am getting this error when trying to generate AUTOSAR code from my model. The model sample rate is 0.002 so I can't change back to -1 here.
How to associate timing event in the mapped runnable ?

답변 (1개)

Menika
Menika 2023년 7월 12일
Hi,
You can follow these steps to associate a timing event in the mapped runnable and resolve the error you are encountering:
  1. Open your model in the Simulink editor.
  2. Go to the "Model Explorer" pane by clicking on the "View" tab and selecting "Model Explorer".
  3. In the "Model Explorer" pane, navigate to the "AUTOSAR" section and expand it.
  4. Locate the mapped runnable named "Input" that corresponds to the "MainModel/Input" block.
  5. Right-click on the mapped runnable and select "Properties" from the context menu.
  6. In the "Properties" dialog box, navigate to the "Events" section.
  7. Click on the "+" button to add a new event.
  8. In the "Add Event" dialog box, select the "TimingEvent" option.
  9. Set the "Period" property to the desired value that matches the sample rate of your function (e.g., 0.002 seconds).
  10. Click "OK" to close the dialog box and save the changes.
  11. Generate the AUTOSAR code again, and the error should be resolved.
Hope it helps!
  댓글 수: 3
Menika
Menika 2023년 7월 13일
Hi,
It may be possible that when you made changes to your Simulink model after opening the code mapping editor, the object handle being referenced in the code mapping editor is no longer valid. Ensure that you have saved your Simulink model and try refreshing the code mapping editor again.
Tejas
Tejas 2023년 7월 13일
I see, thanks for your feedback, I tried that way as well but the same issue continue. However, I tried change in my model by changing runnables, now it's working as expected and generated the code. Thank you!

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

카테고리

Help CenterFile Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by