Listening to events when Matlab GUI application is idle
이전 댓글 표시
Hi, I would appreciate a piece of advice. I have a GUI application. I am able to listen to events (answers from a geodetic instrument) when there is a process running in my application (e.g. measurement). But how to listen to events when the application is idle (no matlab activity currently active, no function running, no button pressed). Is there a function (to where write definition of listening to events) which is active when aplication window rises (program starts) and active until it is closed? Thanks for help Filip
댓글 수: 2
per isakson
2013년 8월 18일
편집: per isakson
2013년 8월 18일
Why do you want that? My first answer is no, but then I am not sure what exactly you mean by "idle" and "no function running".
Filip Dvoracek
2013년 8월 18일
채택된 답변
추가 답변 (1개)
Walter Roberson
2013년 8월 18일
0 개 추천
The closest you could get would be to have your startup.m fire a timer function that periodically checked.
댓글 수: 3
Walter Roberson
2013년 8월 18일
If the application has started and waiting for the user to press a button, then just have a callback on the event that data is ready. See http://www.mathworks.co.uk/matlabcentral/answers/85010-daq-process-usb-6008 for an example.
Filip Dvoracek
2013년 8월 18일
Walter Roberson
2013년 8월 18일
waitfor() is not used for all event types. timers and DAQ go through a different process.
waitfor() is not even used for the main GUI: it is really only used if you are executing something and need something else to complete before you continue. waitfor() is not needed for controls or events that are to be accessible when nothing else is running: the command line process will take notice of those kind of events.
카테고리
도움말 센터 및 File Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!