フィルターのクリア

Add listener() or a callback function to app designer?

33 ビュー (過去 30 日間)
Jay Vaidya
Jay Vaidya 2021 年 6 月 7 日
編集済み: Mohammad Sami 2021 年 6 月 24 日
I want to sense something continuously in my GUI (along with other functionalities of the GUI like all other buttons have different functionalities). I was wondering how to add a listener to my GUI. I would be using a read function to read a bit state of my microcontroller. However, the app designer architecture is not allowing me to edit all the part of the code and hence I am not sure how to proceed with making a function which can continuously sense() one input and then if any other button is pressed then the GUI should enter into the button_callback() function di the job and get back to the sense() function. In other words, I want all the other stuff of my GUI to be as an interrupt and one of the main parts of the code should be the sense() function.
Please let me know your inputs.
Thanks, in advance!
  3 件のコメント
Vimal Rathod
Vimal Rathod 2021 年 6 月 23 日
Try looking into this link which talks about interrupting callbacks.
Mohammad Sami
Mohammad Sami 2021 年 6 月 24 日
編集済み: Mohammad Sami 2021 年 6 月 24 日
Another option for you, if you have parallel processing toolbox is to start the parpool. Then you can use the parfeval function to run your sense function on the parpool. The sense function can use a data queue to send the data back to the main thread. Your GUI can then have a callback to update itself once it receives new data in the data queue. The rest of your GUI can then run normally.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by