How can I control signal logging in referenced models?

AFAIK, the only way to control signal logging in a referenced model is by right clicking on the model block and pulling up the Model Reference Signal Logging dialog. Is there a way to control signal logging in the referenced model programatically? Can it be done through model arguments so as not cause a rebuild?

답변 (2개)

Vieniava
Vieniava 2011년 1월 26일

0 개 추천

Try this:
Z=get_param('YourModel/BlockName','PortHandles');
set_param(Z.Outport, 'DataLogging', 'on');
Where: YourModel is your simulink model name and BlockName is name of block which output signal you'd like to log.

댓글 수: 1

Paul
Paul 2011년 1월 27일
I don't think this can work when the block in question is a Model Reference and I'm trying to control the logging of signals inside the referenced model.

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

Vieniava
Vieniava 2011년 1월 27일

0 개 추천

Phisically go to the block inside referenced model. Next find a handle to this block via
H=get_param(gcb,'Handle);
then
Z=get(H,'Porthandles');
set_param(Z.Outport, 'DataLogging', 'on')
it should work now.

댓글 수: 1

Paul
Paul 2011년 1월 27일
This would work for one reference, but doesn't provide independent control over multiple references to the same model, such as can be achieved using the Model Reference Signal Logging dialog.

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

카테고리

도움말 센터File Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

제품

질문:

2011년 1월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by