Repeatedly call a function in App Designer while working with the App
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I created an app in app designer that has buttons to load, plot, process and analyze data.
How do I implement a function into the app that runs every second while the user can simultaneously work with the app and click on buttons, load data, etc.
I want the app to continously do something regardless of what action the user takes on the app. The app is supposed to communicate with a PLC, read and then send back a signal continuously every second after startup of the app. When the app crashes or is closed the function wont be called anymore.
Thanks.
0 Kommentare
Antworten (1)
Florian Bidaud
am 28 Okt. 2022
Bearbeitet: Florian Bidaud
am 28 Okt. 2022
Hi
Have a look a these:
I can think of roundabouts to avoid using the background pool but they won't do exactly what you want.
2 Kommentare
Florian Bidaud
am 21 Nov. 2022
Sorry to answer that late,
But yes, with the function parfeval, you can call a function in another pool, while keep running your app as usual.
Let's say the code you want to run can be written as [Y1,Y2] = function calculationBackground(X1,X2,X3), you could call
F = parfeval(@calculationBackground, 2, X1,X2,X3)
and then get the results with
[Y1,Y2] = fetchOutputs(F)
For your application you will need to include the pause inside that background function
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!