prevent UIcontrol callbacks from interrupting simulink simulation

1 view (last 30 days)
Greetings,
I have GUI containing a plot and a button. The plot is updated every second because of a timer object. This timer object uses simulink to process some data before updating the plot.
The button opens a menu which prompts the user to confirm an action. If the button is pressed while simulink is busy, simulink is paused until the menu closes (meaning the plot is not updated and time sensitive data is lost). If the button is pressed while simulink is not busy, the plot keeps updating normally, regardless of how long the menu remains open.
I want to prevent simulink from being paused. How do do this? It was my understanding that timer callbacks cannot be interrupted.
Things I have tried so far (which have been unsuccesful):
- The function 'menu' has a while loop in it. placing a 'pause(0.1)' command in there does not solve the problem. - Calling the button's Callback function directly from the matlab command window (which prevents clicking the button) prevents simulink from pausing. I believe this is because statements from the command window are placed on the bottom of the queue.
I have attached files that recreate the problem. Run 'testscript2' to recreate the problem.

Answers (0)

Categories

Find more on Interactive Control and Callbacks 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!