03-14-2011 04:49 PM
I am trying to use a USB-6211 in a very simple Visual Studio C++ system. The ultimate intention is to continuousely output data to the two channels at 180 samples per second. At this point, I have the following commands setup:
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,
devcmd, //physical channel
"", //name assigned
-10.0, //min output value
10.0, //max output value
DAQmx_Val_Volts, //units of output
"" //custom scale name
));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,
"", //source (default to OnboardClock)
180.0, //rate in samples per second
DAQmx_Val_Rising, //active edge
DAQmx_Val_FiniteSamps, //a finite number of samples (to be changed)
samples_to_write //samples to aquire
));
DAQmxErrChk (DAQmxStartTask(taskHandle));
On the last command I get the message:
Non-bufferered hardware-timed operations are not supported for this device and Channel type. I can not make any sense out of this. Any suggestions?
Solved! Go to Solution.
03-15-2011 10:46 AM
Hi mhubel,
Are you getting any specific error code associated with this message?
03-16-2011 08:37 AM
The full error message is:
DAQmx Error: Non-buffered hardware-timed operations are not supported
for this device and Channel Type.
Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or
set Sample Timing Type to On Demand.
Task Name: _unnamedTask<0>
Status Code: -201025
Note that the buffer is be set by samples_to_write which is set to 1800
If you wish to look at I have included the offending routine as an attachment. This message is generated by line 35, the DAQmxStartTask
03-16-2011 10:29 AM
Hi mhubel,
It seems you may be attempting to do a non buffered hardware write, which is not supported by USB devices. One way to fix this is to create a buffer before you start writing. Please refer to the below KB for more information.
http://digital.ni.com/public.nsf/allkb/EC1968728E660B288625780700570D06?OpenDocument
03-16-2011 12:41 PM
I effectively removed the DAQmxStartTask as is implied and it appears to work. This seems counter intutitive. I will never have the time to really understand the whole NI structure as I only use two very simple devices in a simple application. I mostly wish there was a much more direct way to talk to these devices without all the "help" of the whole NI system.
Still the buffering does not work on subsequent calls.
I have spend too much time on this simple issue. It is time to give up and build a D-A that is simple to access.
03-16-2011 08:01 PM
One of your support people helped on the phone. It seems that a somewhat obscure command
DAQmxSetWriteRegenMode(taskHandle, DAQmx_Val_DoNotAllowRegen)
is required to get buffering to work properly. This is a very poorly documented command and there is no real indication that it is required.
03-17-2011 10:07 AM
That's great to hear you got some good immediate support and I apologize about the poor documentation, I am going to go ahead and add this information to the Knowledge Base.
Happy Programming