Problem with timers in a GUI

2 ビュー (過去 30 日間)
Paul Murrin
Paul Murrin 2020 年 9 月 30 日
コメント済み: Adam Danz 2020 年 9 月 30 日
I have a GUI in which I create and start a bunch of timers during the startupFcn. Frequently I get the following error:
Error while evaluating TimerFcn for timer 'statusUpdateTimer'
Trying to load file "<filename>.mlapp" while it is being loaded.
It seems to happen more frequently if the timer is started at the end of the constructor, but I've also seen it at other times (ie not just during construction) on timer callbacks when other GUI operations are running.
What does the error mean and how can I eliminate it?
  5 件のコメント
Paul Murrin
Paul Murrin 2020 年 9 月 30 日
That is the entire error message. I can't trap it so can't obtain a call stack.
I've managed to eliminate it in this instance by adding a startDelay which is longer than the app startup interval. It is a complex GUI app so takes several seconds to initialise. I guess the object is not fully ready when the timer first fires.
I've been grappling with the same error in various forms for a while and I am usually able to mitigate it but never get at the root cause and don't really understand what is going wrong.
Adam Danz
Adam Danz 2020 年 9 月 30 日
Usually errors that occur within AppDesigner indicate where the error is happening and this is an important bit of info. I had a feeling the timer fcn doing something too early within the initialization of the app. Sounds like you solved it with the start delay.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by