MATLAB Answers

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

조회 수: 3(최근 30일)
Takuya Murooka
Takuya Murooka 2020년 7월 17일
댓글: Andrew Brown 2021년 7월 22일
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
Andrew Brown
Andrew Brown 2021년 7월 20일
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.

댓글을 달려면 로그인하십시오.


Cris LaPierre
Cris LaPierre 2021년 7월 22일
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
Andrew Brown
Andrew Brown 2021년 7월 22일
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.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by