In App Designer, how can I ignore UI inputs while a block of code is running?
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
Prajith Chilummula
2019-1-11
You can use the 'Interruptible' property of the UIfigure to control the interruptions.
Soong Yuan See
2020-2-18
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analog Data Acquisition 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!