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
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2020-8-20
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 个评论
Walter Roberson
2020-8-20
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analog Data Acquisition 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
