필터 지우기
필터 지우기

read function in DAQ is hidden by a built in function

조회 수: 9 (최근 30일)
Lars Eriksson
Lars Eriksson 2024년 1월 30일
댓글: Walter Roberson 2024년 2월 1일
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
Lars Eriksson
Lars Eriksson 2024년 2월 1일
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 2024년 2월 1일
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.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simultaneous and Synchronized Operations에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by