From: John on
Hello all,

I have a somewhat complex GUI-based Matlab control panel that is having problems.

Background:
The panel is streaming data out a COM port at a fixed rate (X points every Y seconds). It also reads the com port every Z seconds to look for responses and, if they exist, parses and buffers the responses. A graph is also updated periodically to show the received, buffered data.

Each of these functions is timer-driven:
1. Stream data timer
2. Read COM port timer
3. Update graph timer

The first timer shuts down all of the timers in its callback once all the data has been sent. That is the point where it tends to lock up (and by lock up I mean Matlab freezes, nothing in either window - the GUI or the Matlab window - redraws after other windows cover them up, it won't minimize or maximize or close). There is no processor usage and RAM use does not skyrocket.

What can I be doing that is making Matlab croak? I'm very careful to delete timer objects when I'm done with them; if I were stuck in a "For" loop I could still use Matlab to halt execution of the function.

Thank you!

- John
From: John on
In lieu of an edit function:

To clarify, it does not lock up every time but perhaps 1 in 3 times. It never locks up when I manually stop operation by clicking my "Stop" button - its callback calls the same function as the timer calls when done.

I am using Matlab R2009a.

I'm transmitting about 380 bytes every 1/4 second and receiving back about half as many. I have 4 graphs; the big one is showing up to 9 or 12 traces of up to 2000 points each along with a dozen or so stem plot points and it is being updated every 1/4 second.