How to increase ScansAvailableFcnCount when using MATLAB to control NIDAQ
조회 수: 21(최근 30일)
I am currently trying to use MATLAB to control a NIDAQ (usb-6255) to collect data from my sensor. I want to do real-time plotting while collection the data.
I understand it is a good idea to use a callback function to do the plot like this
dq.ScansAvailableFcn = @(src,evt) plotDataAvailable(src, evt);
I just notice the default ScansAvailableFcnCount is set to a value that the plotting function above will be called 10 times a second (10Hz). My question is: Is there any way to increase the frequnency? I found it is easy to increase the ScansAvailableFcnCount so that the plotting function can be called less than 10Hz. However, when I decrease this value below 0.1*dq.Rate, it will say (here dq.Rate=300)
At the specified rate, the minimum count
allowed is 31.
Thank you very much!
Noah Rubin 2021년 3월 3일
Thank you very much for your reply!
To clarify though, the only issue that is actually preventing us from sampling at a higher rate is the fact that we we have:
Fs = 3000;
dq.Rate = Fs;
nSamples = 0.02*Fs;
dq.ScansAvailableFcnCount = nSamples;
Given that Shengjie, Mauro, and Agostina all had the exact same issue as well-- a 10 Hz read limit exactly for everyone involved in this thread-- I do not believe this is an issue arising from our own use case. Unless I am misinterpreting line 1514 in my earlier screenshot, the 10 Hz limit is being set within the source code itself.
Given that we also have our setup working perfectly with the old toolbox, this convinces me further of that possibility.
If you have any other information, it would be greatly appreciated. I am happy to contact technical support if needed.
Thank you again for your time!