フィルターのクリア

Programmatically Set Test Sequence Ports To Log

4 ビュー (過去 30 日間)
Andrew
Andrew 2023 年 6 月 27 日
回答済み: Prathamesh 2023 年 7 月 21 日
The Test Sequence Editor allows me to set a symbol to log its signal data when the test is running. I'd like to automate this because it is tedious to go into every symbol and set it manually. Is there a way to programmatically set a test sequence port to log its signal data during tests?
I found the documentation to programmatically change other properties of a test sequence port like the data type or the Scope, but I haven't been able to find anyway to access the logging settings. If this is not supported by the sltest.testsequence packages can someone suggest an alternative way to programmatically setup the test harness to log that signal data?
I am using MATLAB R2021a. Thanks!

採用された回答

Prathamesh
Prathamesh 2023 年 7 月 21 日
Hi,
I understand that you want to programmatically log the signal data.
This can be achieved by setting the parameter ‘SignalLogging’ of the signal to be logged as ‘on’.
%set_param function to enable or disable signal logging for a model programmatically
set_param("damped_nonlin_spring",'SignalLogging','on');
%mark signals for logging programmatically
Simulink.sdi.markSignalForStreaming('damped_nonlin_spring/Integrator',1,'on');
Simulink.sdi.markSignalForStreaming('damped_nonlin_spring/Integrator1',1,'on');
Please refer to the documentation below to get more information on signal logging.
Alternatively, you can programmatically set the "LogSignal" parameter to "on" for a specific test sequence port in a Simulink Test harness.
harness = sltest.harness.find('myModel/Test Harness');
sequence = harness.getSequence('mySequence');
port = sequence.getPort('myPort');
set_param(port.getFullName,'LogSignal','on');
Please refer to the documentation for more information.
I hope this helps in resolving your issue.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOutputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by