Problem with timers in a GUI
Show older comments
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 Comments
Adam Danz
on 30 Sep 2020
What does the TimerFcn do? It sounds like there may be some recursion.
Do all of the timers have the same TimerFcn? Perhaps placing a pause(t) between the timer functions would help but that's a shot in the dark without knowing what those functions do.
Paul Murrin
on 30 Sep 2020
Edited: Paul Murrin
on 30 Sep 2020
Adam Danz
on 30 Sep 2020
Can you identify which function is causing the error?
Please share the entire error message including the caller stack if available.
Paul Murrin
on 30 Sep 2020
Adam Danz
on 30 Sep 2020
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.
Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!