How can I control signal logging in referenced models?
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(2 个)
Vieniava
2011-1-26
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.
Vieniava
2011-1-27
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.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!