DAQ issue

조회 수: 3 (최근 30일)
otto caretta
otto caretta 2011년 8월 8일
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
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
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);

추가 답변 (1개)

otto caretta
otto caretta 2011년 8월 9일
chirag, thank you very much for your very useful answer. These analog outputs i use to switch on/off some equipment in the lab, and so i hadnt considered the samplerate side of things. in the past when i used a single value of putdata the signal remained constant until i putdata a different value.
i managed to achieve the same result now by setting: set (AO,'repeatoutput',1);
i never used this before so i am guessing the default value of repeatoutput must have changed in the latest release of the daq toolbox! bad boys the guys who pushed out a modified version of the default settings!!
Anyway, thank you very much for your very helpful input. kind regards otto

카테고리

Help CenterFile Exchange에서 Data 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