필터 지우기
필터 지우기

Code generation with a System Composer model

조회 수: 22 (최근 30일)
antonio-deepware
antonio-deepware 2023년 5월 24일
답변: Josh Kahn 2023년 5월 25일
Hi,
I'm trying to generate the code with system composer containing simulink models.
This is the software architecture. Following is the error:
unfortunally I have to put the option "Periodic sample time constraint" to "Ensure sample time indipendent". I thik that the problem is that we have this signals es: DataCalc_D etc. that are used for the scheduling. This is also the reason, maybe, why the scheduling editor is not working as expected.
These sw component must be time-triggered, not Event-triggered. So basically I would like to know how to convert this models to time-triggered task.
Thank you,
Antonio
  댓글 수: 2
Josh Kahn
Josh Kahn 2023년 5월 25일
Do you have a mix of export-function models and rate-based models? or is the intent for them all to be rate-based? Also, do you have an external scheduler or are you looking for the scheduler to be part of the generated code?
Josh
antonio-deepware
antonio-deepware 2023년 5월 25일
Actually there are only rate-based models. I'd like to generate also the scheduler.
thanks,
Antonio

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

채택된 답변

Josh Kahn
Josh Kahn 2023년 5월 25일
Do either of these options solve your problem?
Option 1:
Include the software architecture as a reference model in a parent Simulink model so that you can add a scheduler as a combination of function call generators or a function call generator coupled with a stateflow chart to ensure execution order). The scheduler in the software architecture model is for simulation only so that is why the parent Simulink model is needed where you can create a more granular scheduler. I attached an example of this to the answer (See SWArch_Implementation.slx).
Option 2: (less preferable if you are doing software architecture work)
Use the regular architecture template instead of the software architecture template. The software architecture template is permanently an export-function model whereas the regular architecture template is rate-based.
Regards,
Josh

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 System Composer에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by