Matlab 2019b don't recognise "Data Acquisition Commands"

11 ビュー (過去 30 日間)
Hassan Mehmood Khan
Hassan Mehmood Khan 2020 年 7 月 29 日
コメント済み: Walter Roberson 2020 年 7 月 29 日
I have been trying to connect NI USB 6009 to Matlab 2019b
Session base commands are recognised
I want to send Digital OUT signal ,but the "Session Commands" to ON or OFF Digital Output i cannot figure out
When i use these commands ,its working
d = daq.getDevices;
s = daq.createSession('ni');
sig = addDigitalChannel(s,'Dev1','port0/line0','OutputOnly');
signalData = sin(pi/2);
startBackground(s);
Following Messages i have
I want to use Data Acquisition Following are the commands i want to use , but the Matlab dont recognise them;
>> d = daqlist("ni")
Unrecognized function or variable 'daqlist'.
>> d = daqlist("ni")
Unrecognized function or variable 'daqlist'.
>> daq("ni")
Unrecognized function or variable 'daq'.
I have already checked the Data Acqusition Toolbox is installed. but Data Acqusition Commands are not recognisable.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 7 月 29 日
編集済み: Walter Roberson 2020 年 7 月 29 日
  2 件のコメント
Hassan Mehmood Khan
Hassan Mehmood Khan 2020 年 7 月 29 日
The artcile was not of so help
I am sorry i am very new to DAQ in Matlab.
I only want to turn on and off digital IO using NI USB 6009
I am using the code below
d = daq.getDevices;
s = daq.createSession('ni');
s.Rate = 5;
oneCycle = 1;
addDigitalChannel(s,'Dev1','port0/line0','OutputOnly');
outputSingleScan(s,oneCycle);
Walter Roberson
Walter Roberson 2020 年 7 月 29 日
The article says clearly that you cannot use startForeground or startBackground with digital pins for a fair number of National Instrument DAQs, and that even for the ones that permit using those calls, that it is often restricted as to which pins can be used.
The NI USB 6009 is a fairly low-end model. You probably cannot use the calls with any of the digital pins for the USB6009.
Using outputSingleScan is the way to proceed for the digital pins.

サインインしてコメントする。

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by