필터 지우기
필터 지우기

How to set the sample time of a subsystem?

조회 수: 35 (최근 30일)
Istvan
Istvan 2014년 2월 11일
편집: Stefanie Schwarz 2023년 10월 14일
I have a model for xPC in which I have different masked subsystems. As they do different tasks, they need to run with different timesteps (some do fast acquisition, others need longer time to run and do communication or other slow tasks). Subsystems trigger each other (start each other - obviously the faster one is in control).
How can I define the sampling time of a subsystem (and all components inside)?
I'm using fixed step solver. What timestep do I need to set for it? - the shortest one that I use in any subsystem?
Thank you for any suggestion.
-any single core solution out there?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 11일
편집: Stefanie Schwarz 2023년 10월 14일
Try a zoh block just before your subsystem and set sample time of your subsystem blocks to inherited
Add
If your subsystem doesn't contain a continuous block, right click on your subsystem, click on block parameter(subsystem) then check treat as atomic unit, and set your sample time
  댓글 수: 4
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 11일
The zoh is used before a continuous blocks. Its input is maintained the same until the next sample. The zoh doesn't delay anything.
If your subsystem doesn't contain a continuous block, right click on your subsystem, click on block parameter(subsystem) then check treat as atomic unit, and set your sample time
Istvan
Istvan 2014년 2월 12일
편집: Stefanie Schwarz 2023년 10월 14일
Great! I think this is it (treat as atomic units) :) I have discrete states so it's exactly what I needed. After setting the treat as atomic unit box, with the Mask editor I could put the sample time property on the block interface. Thank you very much again!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by