enable log signals through command line.
이전 댓글 표시
I have several reference models which has logging/test point signals. I use Simulink Signal Logging Selector to enable/disable these signals but I would like to do this through the command line. How do I do this? I have tried Simulink.SimulationData.ModelLoggingInfo.createFromModel. What do i do after this? I also then tried findSignal but it always comes back with an empty array.
채택된 답변
추가 답변 (1개)
Jonny
2017년 11월 13일
I realize this is an old thread and an answer has been accepted, however it appears at the top of google search results. I thought I'd add a method that preserves the logged signal in the Simulink model but programmatically disables logging. The code below is essentially the same as unchecking the "DataLogging" boxes in the Simulink Signal Logging Selector. Make sure logging mode is set to "Override signals." This tutorial was helpful as well: Log Data in Library Charts
mi = Simulink.SimulationData.ModelLoggingInfo.createFromModel(gcs);
for i = 1:numel(mi.Signals)
mi.Signals(i).LoggingInfo.DataLogging = 0;
end
set_param(gcs, 'DataLoggingOverride', mi)
댓글 수: 2
Mariam Achraf
2020년 7월 26일
편집: Mariam Achraf
2020년 7월 26일
Hello,
which version are you using please ?,as I can not seem to find this option 'DataLoggingOverride' any where in the data Import window
Jonny
2020년 7월 27일
I am using 2016b.
카테고리
도움말 센터 및 File Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!