A problem about the Sample Time in the asynchronous subsystem

조회 수: 9 (최근 30일)
w w
w w 2011년 11월 18일
Hi, There is a subsystem in my model.The model's sample time is 0.0001,and i want to set some block's sample time in the subsystem 0.0005.But when i click the build button ,i got the error as follows:
Error building Real-Time Workshop target for block diagram '2812_StepTime'. MATLAB error message: '2812_StepTime/Function-Call Subsystem/Counter Limited/Output' has an invalid sample time. Only constant (inf) or inherited (-1) sample times are allowed in the asynchronous subsystem '2812_StepTime/Function-Call Subsystem/Counter Limited'
How could solve this problem?
My matlab version: 2009a
Best regards.

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 11월 18일
Hi,
this can't work: you call you subsystem with a function call asynchronously, so blocks inside the subsystem have no "direct" control about when the subsystem is called. How could a block inside impose a sample time? It would need to carry this information to the containing subsystem... Perhaps you could explain in more detail why a block inside the fcn call subsystem should have a fixed sample time...
Titus
  댓글 수: 2
w w
w w 2011년 11월 18일
The subsystem is called by a Hardware Interrupt block.If the blocks in the subsystem should be with different,is there any ways to solve ths situation?
Titus Edelhofer
Titus Edelhofer 2011년 11월 18일
One way to overcome many problems: move the offending block outside the subsystem and feed the output of the block as an input to the subsystem (probably using a rate transition block in between). Further advice is I guess only possible with more information aout why you want to have a fixed sample time block in your subsystem.

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

추가 답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 18일
It makes sense, right? Your "2812_StepTime/Function-Call Subsystem/" is a function-call system, which could be called irregularly, depending on where the function call trigger comes from. Thus, it can not guarantee the inside block "Counter Limited/Output" be called in a fixed rate.
It sounds like you are using a function call generator block with a fixed sample rate. Why not try to specify your subsystem as an atomic subsystem with a fixed sample rate of 0.0001. I believe that will get rid of the error.
  댓글 수: 1
w w
w w 2011년 11월 18일
The subsystem is called by a Hardware Interrupt block.So i could not use the atomic subsystem.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by