Which are the issues occurring when I am acquiring data in background and I want to execute a callback function which is much more time demanding
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
DAVIDE DELLA VALLE
il 20 Ago 2020
Commentato: Walter Roberson
il 20 Ago 2020
Hello everybody,
I am working with the data acquisition toolbox. I built a GUI that allows to acquire data in back ground.
The next step is to add a few callback functions, by using addlistener that allows to process the data acquired in real time and carry out some vibration analyses.
In the case the added callback funtion execution takes longer than 1 second, which issues I will have?
Thanks for any answer.
0 Commenti
Risposta accettata
Walter Roberson
il 20 Ago 2020
Data acquisition and transfer into internal buffers takes place in the background even when you are inside a listener callback, if I understand correctly (it is possible I am wrong about this.)
The buffers would continue to fill until the configured buffer size had been reached.
If the buffer gets filled, then incoming data will be dropped.
If your analysis occassionally takes longer than the interval between incoming samples, then you might be okay.
If your analysis regularly takes longer than the interval between incoming samples, then you need to log signals (somehow) or select the most important ones for later processing.
If yur analysis sometimes takes much longer, then if that is probabilitistic, then even if the events are independent you would run the risk of filling up the buffer if you happened to get a burst of those long-analysis events in a row, even if the mean time to process was relatively low.
2 Commenti
Walter Roberson
il 20 Ago 2020
Every one second you need 8 CPU seconds of data processing. The one way to handle that in real-time is to add 7 more CPUs every second.
The alternative is to buffer the data until you can get around to it. As the buffer would be building up at roughly 400 kilobytes per second, you could only sustain that for perhaps 10000 seconds. This would, however, not be considered real time: after 7 1/2 minutes you would already be an hour behind in the processing.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Analog Data Acquisition in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
