ended up realizing my start was based around time rather than number of scans. Still have some rounding errors but overall have a much better idea
Trying to acquire Data using the data acquisition tool and setting the rate leads to the ScansAvailableFcn not running enough times.
3 次查看(过去 30 天)
显示 更早的评论
I am creating an app in app designer and am using the data acquisition toolbox. I for the app I need to change the rate of the data acquistion using the "Rate" variable but, the number of data points that is collecting per trigger cannot be in decimals and but be a positive integer (understandably). For example I am trying to collect at 2048Hz ("Rate") and the number of scans per trigger can only be set to 205 or 206 and will try to get triggered 10 times. With either of these it ends up going to 0.9s of a 1.0s trial but there are not enough points of data for the trigger to trigger the final 0.1s of data collection. I have also tried to chagnge the ScansAvailableFcnCount within the trigger after the 9th run but that does not seem to work either? I am not 100% if I did it correctly but I did try the best I could. When I have tried to change the number of scans (points of data) that it collects per trigger It will just set it back to the closet one that the selected "Rate" would automatically set it to(either 205 or 206). Does anyone have any solution for this problem?
The "Rate" variable needs to be able to be equal to anything from 120-2048 but I am currently just trying to figure out how I can get the ScansCallback to read in the last couple hundred points of data.
Any and all help is greatly appreciated!
Thanks!
I took the follow picture from the 9th run of the trial
回答(1 个)
Mario Malic
2024-5-7
Hey,
Rate cannot be any number, it is predetermined by components (hardware) inside the acquisition system. In the manual, you can find exactly what it can be. Even though you set it on a different number, the closest available sampling rate will be used (you won't even get a warning for that).
You can determine the time it takes you to acquire exact number of samples, add a little bit extra just to make sure you capture everything and then discard the samples that you don't need.
You can also use property NumScansAcquired to stop the acquisition.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analog Devices ADALM1000 Support from Data Acquisition Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!