How is it possible to deactivate signal logging of referenced models in the InitFcn callback?

조회 수: 2 (최근 30일)
How is it possible to deactivate signal logging of referenced models in the InitFcn callback?
While doing this with
>> set_param(bdroot, 'InstrumentedSignals', [])
in InitFcn callback in the model callbacks, I see the following error:
Error evaluating 'InitFcn' callback of block_diagram 'modelName'.
Callback string is 'set_param('bdroot', 'InstrumentedSignals', []) '
Caused by:
It is incorrect to modify the model 'modelName' from the InitFcn callback of a different model.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 9월 16일
Doing it like in the described way is indeed not possible, but it sounds like the Signal Logging Override feature is exactly what you are looking for:
This feature allows the user to override the signal logging for the entire model hierarchy without the need for modifying referenced models. Using the override you log a subset of the signals selected to log in each model or none of them. There is both a programmatic and graphical approach for this, which can both be found from the documentation above.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by