How should I do to realize to acquire data at faster rate?

5 visualizzazioni (ultimi 30 giorni)
I would like to call listener and acquire analog signals with NI-DAQ at faster rate <100 ms continuously.
For example, I setted a scan rate to 250k/scans (this is a muxmum rate of my NI-DAQ) and a value of ScansAvailableFcnCount to 2500 to acquire data by every 10 ms. However, a following error occured: "At the specified rate, the minimum count allowed is 25000". I guess this message indicates that I can only acquire data by 100 ms or longer duration.
Previous version (MATLAB 2019b), I can set data available counts setting a property, NotifyWhenDataAvailableExceeds. However, the use of DataAvailable is not recommended for latest version.
How should I do to realize to acquire data faster?
  1 Commento
Andrew Brown
Andrew Brown il 20 Lug 2021
Have you figured out a solution to this problem? I am encountering the same issue. I want to refresh a plot with new data brought in by the callback function at least 30 times per second, but it seems 10 times per second is the max, which is not fast enough for smooth live plotting.

Accedi per commentare.

Risposte (1)

Cris LaPierre
Cris LaPierre il 22 Lug 2021
It is not that the NotifyWhenDataAvailableExceeds is not recommended, it is that the entire session interface approach has been replaced with the DataAcquisition interface. This started with release R2016a (I believe).
You can see an example that compares session interface code with dataacquisition interface code using this feature here:
Once your code is transitioned to the DataAcquisition interface, it looks like the new functionality is named ScansAvailableFcnCount.
If instead you are sticking with the session interface approach, then you will still need to use NotifyWhenDataAvailableExceeds.
  1 Commento
Andrew Brown
Andrew Brown il 22 Lug 2021
I use the new syntax calling the scansAvailableFcn and setting scansAvailableFcnCount. I am taking data at 100kHz and I get an error if I try to call the callback function any more often than every 10k scans (10 times per second) which makes updating a live plot at more than 10Hz impossible. The new syntax does not fix this problem unfortunately.

Accedi per commentare.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by