Clear Filters
Clear Filters

read function in DAQ is hidden by a built in function

3 views (last 30 days)
I want to run read in DAQ toobox but get an error message:
Incorrect number of types of input or output for function 'read'.
When I type "help read" I get:
read - read one or more video frames
when I run "which read"
read is a built in method
So the daq read function is shadowed by something else how can I get rid of the shadowing so that I can use read from DAQ toolbox?
Lars Eriksson
Lars Eriksson on 1 Feb 2024
Thanks for the feedback and input.
The s=daq.createsession() works fine for me (when I wrote my last comment I wasn't sitting at the measurement computer with the daq card to see if I wrote 'NI'/'ni'/"ni", it was done in a separate script, the rest was copied verbatim from the script I used). Whatever string I used, I got the session working and could control the device, and I could do most things with outputs/inputs. I could get the work done and acquired a sample of the right size by setting up an output and queueing a dummy output with the right length using queueoutput(s,dummy) and then running it with out=daq.startforeground(s). However, this is like going over the river for water when it is only the result of the vanilla read-function that I needed for my usage.
The read statement proposed doesn't have any way to control the length of acquisition. I need to have the right sampling time and length to match the data. I want to use this from the help.
scanData = read(d,span)
Unfortunately I'm out travelling so I can't test if this particular call to the read function gives the same error message or if it get passed to the right read function, I will do it as soon as I'm back.
There are plenty of variants of the "read" function. Writing "help read" gives "read - Read one or more video frames" on my machines. Clicking on "other uses of read" gives a batch of functions that are named "read". Matlab didn't detect the one I wanted to use, I'll experiment further when I am back after my travels.
Walter Roberson
Walter Roberson on 1 Feb 2024
s = daq("ni");
potentially creates a different kind of object.
I agree that read(s) does not permit you to specify the number of scans. The point is to test whether read(s) will give the error about incorrect number of parameters.

Sign in to comment.

Answers (0)


Find more on Simultaneous and Synchronized Operations in Help Center and File Exchange





Community Treasure Hunt

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

Start Hunting!