close simulink diagnostic viewer programmatically or make sldiagviewer.diary invisible

12 ビュー (過去 30 日間)
Zexuan Zhang
Zexuan Zhang 2022 年 11 月 23 日
コメント済み: Zexuan Zhang 2023 年 9 月 8 日
Hi,
I am trying to utilize the sldiagviewer.diary feature to capture simulation diagnostic information while running the simulation in background (invisible) with load_system('modelName').
However, this diagnostic viewer is not always invisible like the model nor can I close the diagnostic viewer programmatically after the simulation is completed without closing the simulink model. The reason behind the diagnostic viewer popping up instead of staying invisible is that the simulation uses assertion to stop the simulation.
Any suggestions?
Thank you.

回答 (1 件)

Shuba Nandini
Shuba Nandini 2023 年 9 月 6 日
Hello Zexuan,
I understand you want to close Simulink Diagnostic Viewer programmatically but when any error occurs, the Diagnostic Viewer automatically opens to display the diagnostic information.
This is the intended behaviour to help you quickly identify and address issues in your Simulink model, but you can use the function “sldiagviewer.diary(toggle)” which turns logging to the log file on or off.
>> sldiagviewer.diary('off')
The setting applies to the last file name you specified for logging or to diary.txt if you did not specify a file name.
Please refer to the following example that demonstrates how to enable or disable logging to a .txt file: Log simulation warnings and errors and build information to file - MATLAB sldiagviewer.diary - MathWorks India
Hope this helps!
Regards,
Shuba Nandini
  1 件のコメント
Zexuan Zhang
Zexuan Zhang 2023 年 9 月 8 日
Hi Shuba,
Thanks for responding, however it is not the solution to what I am looking for. I am using the sldiagviewer.diary('off') to control the log file already. I was seeking a mean to close the viewer window automatically.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConfigure and View Diagnostics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by