Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
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 comentarios
Prajith Chilummula
Prajith Chilummula el 11 de En. de 2019
You can use the 'Interruptible' property of the UIfigure to control the interruptions.
Soong Yuan See
Soong Yuan See el 18 de Feb. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by