Configure signal logging programmatically (Simulink)

조회 수: 43 (최근 30일)
Dane
Dane 2023년 12월 19일
댓글: Fangjun Jiang 2025년 5월 7일
I have a model (inherited) that has over 200 signals set to log. I would like to remove all of these signals from logging and then add my own, programatically.
I understand there's two modes of signal logging: "Log all signals as specified in model" and "Override signals".
From my understanding, all the current programmatic ways of configuring logging, such as setting block parameter "DataLogging", will change the logging setup in the mode "Log all signals as specified in model". This is my current solution, although I don't know of a computationally efficient way to first remove all current signals set to log. The only method I can think of is to check all block and signal properties for "Log signal data" and "DataLogging" parameter values, which would be too computationally expensive. The other option is to manually right click and remove from logging the entire 200+ signals... Is there a better way?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2023년 12월 19일
You could re-set all those 200 signal loggings and then set what you want to log programingly.
lh=find_system(ModelName,'FindALl','On','type','line');
set(lh,'DataLogging',false);
See doc
web(fullfile(docroot, 'simulink/ug/configuring-a-signal-for-signal-logging.html#bsw9xr9-1'))
  댓글 수: 2
DanielFromIllinois
DanielFromIllinois 2025년 5월 5일
I'm unsure if the above way work because the documentation link isnt available anymore (I tried running it).
See the following documentation to date. simulink.sdi.marksignalforstreaming
Fangjun Jiang
Fangjun Jiang 2025년 5월 7일
The web() link is valid in R2022b.

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

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by