The data argument must contain one column for each output channel in the session
3 ビュー (過去 30 日間)
古いコメントを表示
I'm having trouble understanding what I'm doing wrong that results in this error. It seems like a bug. I've attached a minimum working example below:
>> instrreset; clear all;
>> ao0 = daq.createSession('ni');
>> ao0chan = addAnalogOutputChannel(ao0,'Dev1',0,'Voltage');
Warning: A channel that does not support clocked sampling was added to the session. Clocked operations using
startForeground and startBackground will be disabled. Only on-demand operations using inputSingleScan and
outputSingleScan can be done.
>> dio = daq.createSession('ni');
>> addDigitalChannel(dio,'Dev1','Port0/Line0:7','OutputOnly');
Warning: A channel that does not support clocked sampling was added to the session. Clocked operations using
startForeground and startBackground will be disabled. Only on-demand operations using inputSingleScan and
outputSingleScan can be done.
>> addDigitalChannel(dio,'Dev1','Port1/Line0:3','OutputOnly');
>> outputSingleScan(dio,[0 0 0 0 0 0 0 0 0 0 0 0])
>> outputSingleScan(dio,[0 0 0 0 0 0 1 0 0 0 0 0])
>> outputSingleScanoutputSingleScan(ao0,1)
>> outputSingleScan(dio,[0 0 0 0 0 0 0 0 0 0 0 0])
The data argument must contain one column for each output channel in the session.
>> dio
dio =
Data acquisition session using National Instruments hardware:
Clocked operations using startForeground and startBackground are disabled.
Only on-demand operations using inputSingleScan and outputSingleScan can be done.
Number of channels: 12
index Type Device Channel MeasurementType Range Name
----- ---- ------ ----------- --------------- ----- ----
1 dio Dev1 port0/line0 OutputOnly n/a
2 dio Dev1 port0/line1 OutputOnly n/a
3 dio Dev1 port0/line2 OutputOnly n/a
4 dio Dev1 port0/line3 OutputOnly n/a
5 dio Dev1 port0/line4 OutputOnly n/a
6 dio Dev1 port0/line5 OutputOnly n/a
7 dio Dev1 port0/line6 OutputOnly n/a
8 dio Dev1 port0/line7 OutputOnly n/a
9 dio Dev1 port1/line0 OutputOnly n/a
10 dio Dev1 port1/line1 OutputOnly n/a
11 dio Dev1 port1/line2 OutputOnly n/a
12 dio Dev1 port1/line3 OutputOnly n/a
Properties, Methods, Events
>> ao0
ao0 =
Data acquisition session using National Instruments hardware:
Clocked operations using startForeground and startBackground are disabled.
Only on-demand operations using inputSingleScan and outputSingleScan can be done.
Number of channels: 1
index Type Device Channel MeasurementType Range Name
----- ---- ------ ------- ------------------- --------------- ----
1 ao Dev1 ao0 Voltage (SingleEnd) 0 to +5.0 Volts
Properties, Methods, Events
>>
I'm using a NIST NI USB-6009 DAQ, if it helps.
4 件のコメント
Walter Roberson
2019 年 2 月 25 日
編集済み: Walter Roberson
2019 年 2 月 25 日
I have been wondering what would happen if you were to try to write as many elements as were appropriate for the other device set -- so when it is complaining about columns for ao0, would it complain if you tried to send to ao0 12 samples ?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Digital Input and Output についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!