Effacer les filtres
Effacer les filtres

read function in DAQ is hidden by a built in function

9 vues (au cours des 30 derniers jours)
Lars Eriksson
Lars Eriksson le 30 Jan 2024
Commenté : Walter Roberson le 1 Fév 2024
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?
  6 commentaires
Lars Eriksson
Lars Eriksson le 1 Fév 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 le 1 Fév 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Simultaneous and Synchronized Operations dans Help Center et File Exchange

Tags

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by