Defining sample Time of Model Reference block by using model mask

조회 수: 4 (최근 30일)
qfladen
qfladen 2018년 5월 29일
댓글: qfladen 2018년 6월 5일
Hello everybody,
I have a model that contains a controller. I want that model's sample time and a few sample times inside the model to be specified by a specific value that I can enter using a model mask. I tried setting the sample time of the model and the sample times of a few other blocks to "sampleTime", then I defined a new matlab variable in the model workspace called "sampleTime" and ticked the "argument" checkbox. Then I created a mask in order to specifiy that sample time, however when simulating the model as a model reference block, simulink gives me the error "Parameter 'SampleTime' of 'singlePid/i_nomA_dig' (and also for all other blocks where the sample Time was specified) is non-tunable but refers to model arguments (sampleTime)". Is there a way to set the parameter to tunable? Or is there any other way to specify that value?
Greetings,
David

답변 (1개)

TAB
TAB 2018년 5월 30일
Model can resolve the sample time from base workspace only.
Just create the variable "sampleTime" in base workspace. In your mask, use mask initialization to change the value of "sampleTime".
For example: If you have edit dialog in mask and its name is mskChildMdlSampleT, then write below in maks initialization pane:
assignin('base', 'sampleTime', mskChildMdlSampleT);
  댓글 수: 1
qfladen
qfladen 2018년 6월 5일
Hi Tabrez, I understand that for the sample time of the model itself. However, even when I set the model sample time to some fixed value, I still can not specify other sample times, e.g. a port sample time. The error message is
Parameter 'SampleTime' of 'singlePid/i_nomA_dig' is non-tunable but refers to model arguments (sampleTime)
Is there any way to solve that?

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

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by