Clear Filters
Clear Filters

In App Designer, how can I ignore UI inputs while a block of code is running?

4 views (last 30 days)
I'm using the App Designer to build a small app to use a National Instruments Daq (USB-6343) to do both analog input and output. I have two different "modes" that I use. Mode #1 (button #1) outputs and records for a set period of time. Mode #2 (button #2) outputs continuously until another button press (button #3). In the code for button #3, I reset the daq using "daqreset" and re-establish each of the channels that I want to use for Mode #1 (I use Mode #1 much more frequently, so it is much faster if I don't have to set up the daq every time inside button #1 code). If I wait 5-10 seconds after pressing button #3, then I have no problems pressing button #1. However, if I try to click button #1 too soon after clicking button #3, then the App crashes with various errors related to the daq, I believe because the previous code from the end of button #3, which resets the daq, has not finished running, so the daq settings are not correct for the commands I use in button #1.
I would like to be able to ignore all button clicks / user inputs from the UI until all active code has finished running the daq reset section (button #3), to prevent users from accidentally crashing the App. I have found examples of pausing the matlab code until there is a user input, but I would like to do the opposite. Are there any commands / strategies to accomplish this?
  2 Comments
Prajith Chilummula
Prajith Chilummula on 11 Jan 2019
You can use the 'Interruptible' property of the UIfigure to control the interruptions.
Soong Yuan See
Soong Yuan See on 18 Feb 2020
the reminder that pop out at the bottom of the GUI figure blocking me from resizing the GUI. This pop out is really disturbing the user experience.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!