MATLAB Answers

How to increase ScansAvailableFcnCount when using MATLAB to control NIDAQ

14 views (last 30 days)
Shengjie Gao
Shengjie Gao on 7 Sep 2020
Commented: Mauro Monsalve on 17 Nov 2020 at 16:16
Hey guys,
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!


Sign in to comment.

Answers (1)

Anmol Dhiman
Anmol Dhiman on 13 Sep 2020
Hi Shengjie,
Refer to link under Set ScansAvailableFcnCount to change the value for ScansAvailableFcnCount.
Anmol Dhiman


Shengjie Gao
Shengjie Gao on 14 Sep 2020
Hey Anmol,
Thank you for your reply. I went through the link you provided and still, as I mentioned in my original post, it looks like the maximum time that ScansAvailableFcnCount can be called in one second is 10 times (10*scan rate). Is there any way to increase this count to like 15 times a second (15*scan rate).
Mauro Monsalve
Mauro Monsalve on 17 Nov 2020 at 16:16
Hi Anmol and Shengjie,
I have the same question. Is it possible to increase that frequency or not?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!