DAQ issue
1 回表示 (過去 30 日間)
古いコメントを表示
hello, i have a control script for a nidaq card which has been running well untill recently but has now decided to make troubles. i am under institutional pressure to find an urgent fix... please help!
the hadrware/software is as follows:
AdaptorDllName: 'C:\Program Files\MATLAB\R2010b\toolbox\daq\daq\private\mwnidaqmx.dll' AdaptorDllVersion: '2.17 (R2010b)' AdaptorName: 'nidaq' BoardNames: {'USB-6229'} InstalledBoardIds: {'Dev1'} ObjectConstructorName: {'analoginput('nidaq','Dev1')' 'analogoutput('nidaq','Dev1')' [1x25 char]}
a simplified version of the script is:
AO=analogoutput('nidaq','Dev1'); chano=addchannel(AO,0:3); putdata(AO, [0 0 0 0]); start(AO);
the error message is:
??? To run in a hardware-clocked output mode, this hardware requires that at least 2 samples be queued using PUTDATA. You must pad your output with additional samples to use PUTDATA, or use PUTSAMPLE instead.
Error in ==> daqdevice.start at 62 start( daqgetfield(obj,'uddobject') );
obviously putsample doesnt work either and (putsample(AO, [0 0 0 0]);) produces:
??? Data must be queued using PUTDATA before starting.
Error in ==> daqdevice.start at 62 start( daqgetfield(obj,'uddobject') );
thank you very much. kind regards. otto
1 件のコメント
Sean de Wolski
2011 年 8 月 8 日
Obvious things to check: was nidaq card plugged in/found before you started MATLAB and has it been uninterrupted since starting?
採用された回答
Chirag Gupta
2011 年 8 月 8 日
Couple of quick things: When you start AO, you are staring a clocked operation with this particular board based on the sample rate.
AO.SampleRate
should give you the default sample rate (number of samples outputted per sec). The default setting of the object is to run for 1 sec (duration). So when you start an AO object, the object expects samples = the (SampleRate*duration) to be already queued.
So if wish to output zeros to all the channels for the 1 second, you need queue enough data to output.
Something like this:
data = zeros(AO.SampleRate*duration, 1); % duration = 1
putdata(AO,[data data data data]);
start(AO);
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
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!