02-25-2013 07:27 AM
We are using the DAQmx library called by a C program. Part of the application is to drive the D-A on the device at a clocked rate (1 to 10 KHz). The problem call is:
DAQmxErrChk (DAQmxCfgSampClkTiming(DAtaskHandle,
"", //source (default to OnboardClock)
5000, //rate in samples per second
DAQmx_Val_Rising, //active edge
DAQmx_Val_ContSamps, //Continuous sampling
600 //samples to send
));
and it returns the error:
Non-buffered hardware-timed operations are not supported for this device and Channel Type.
The mode DAQmx_Val_HWTimedSinglePoint has also been tried without success. As the USB-6211 claims in the specs to be capable of sending D-A values out at up to a 250 KHz rate, there must be something like this which works. Any suggestions?
02-25-2013 09:26 AM
Found a solution. It seems the default buffer size is 0 so the buffer must be configured. The following sequence works:
DAQmxErrChk (DAQmxCreateAOVoltageChan(DAtaskHandle,
devcmd, //physical channel
"", //name assigned
0.0, //min output value
5.0, //max output value
DAQmx_Val_Volts, //units of output
"" //custom scale name
));
DAQmxErrChk (DAQmxCfgOutputBuffer (DAtaskHandle, 600)); //set buffer size to 600
DAQmxErrChk (DAQmxCfgSampClkTiming(DAtaskHandle,
"", //source (default to OnboardClock)
5000, //rate in samples per second
DAQmx_Val_Rising, //active edge
DAQmx_Val_ContSamps, //Continuous sampling DAQmx_Val_HWTimedSinglePoint,
600 //samples to send
));
DAQmxErrChk (DAQmxWriteAnalogF64(DAtaskHandle,
600, //samples per channel
1, //auto start
10.0, //timeout in seconds
DAQmx_Val_GroupByChannel, //data layout
data, //data to output
NULL, //samples written
NULL //reserved
));