필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Ryan Budde
Ryan Budde 2019년 1월 8일
댓글: Soong Yuan See 2020년 2월 18일
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
Prajith Chilummula 2019년 1월 11일
You can use the 'Interruptible' property of the UIfigure to control the interruptions.
Soong Yuan See
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 CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by