Digital input using DataAcquisition interface MATLAB 2020a

1 回表示 (過去 30 日間)
Darun Barazanchy
Darun Barazanchy 2020 年 7 月 24 日
回答済み: Harsha Priya Daggubati 2020 年 7 月 27 日
I noticed that MATLAB no longer recommends some functions, like addDigitalChannel, in version 2020a onwards. Currently, I am creating an app to acquire signal from several NI DAQ-cards. However, I get an error I can't solve:
"Check for missing argument or incorrect argument data type in call to function 'addinput'".
The small example code below gives me that same error. I have looked at the documentation and my 'addinput'-line seems correct.
Has any of you experienced this issue? It seems like I am missing something obvious.
Thanks in advance.
daqreset
method = 1;
if method == 0 % Old method <2020a
d = daq.getDevices;
sCheck = daq.createSession('ni');
chCheck = addDigitalChannel(sCheck,'SimDev1', ...
'Port0/Line0:2','InputOnly');
[data,~] = inputSingleScan(sCheck)
else
d = daqlist("ni")
addinput(d,"SimDev1",...
"port0/line0","Digital");
end

回答 (1 件)

Harsha Priya Daggubati
Harsha Priya Daggubati 2020 年 7 月 27 日
Hi,
Can you try using 'daq' instead of 'daqlist'.
d = daq("ni");
addinput(d,"SimDev1",...
"port0/line0","Digital");
Hope this helps!

カテゴリ

Help Center および File ExchangeData Acquisition Toolbox Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by