Info

This question is closed. Reopen it to edit or answer.

How to ensure all timers in callback are started?

1 view (last 30 days)
Manuel Thomet
Manuel Thomet on 1 Jun 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
I have a GUI which has a button to start three timers (t1, t2, t3). The purpose is to get data from an external device. The timer functions store the data (t1), plot the lines (t2) and update the axes (t3) at given times.
Now my problem is, that for some reason the skript "remains" in the second timer (t2) function and never comes back to the pushbutton callback to start the third timer (t3).
I tested this behavior, and found that with very simple timer functions it works fine (i.e. all timers start). The 'BusyMode' is set to 'queue' and 'ExecutionMode' to 'fixedRate'.
So my assumption is that if a timer function takes longer to execute than the subsequent timer firing, Matlab is forced to remain in this timer function, without the capability to execute any other task in the skript (e.g. start t3).
Can somebody confirm this or point me to a solution to ensure that all timers are started?
-> I tried "parfor" with the idea to start the timers parallel. No success because i had no interaction with the GUI any more (timers were all started, but no updates in the GUI happened).

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!