04-18-2011 06:49 AM - edited 04-18-2011 06:53 AM
I want to use 6221 for buffered pattern generation, so I wrote a little code to test this function:
* * *
DAQmxCreateTask("", &taskHandle);
DAQmxCreateDOChan(taskHandle, "Dev1/port0", "", DAQmx_Val_ChanForAllLines);
DAQmxCfgSampClkTiming(taskHandle, NULL, 100000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 50000);
DAQmxWriteDigitalU8(taskHandle, 8, 0, 10, DAQmx_Val_GroupByChannel, data, NULL, NULL);
DAQmxStartTask(taskHandle);
* * *
When I start the task I get: "External sample clock source must be specified for this application."
???
I don't understand it.. as described in the docs, this hw supports digital pattern I/O.
What's the problem?
Thanks
- George -
Solved! Go to Solution.
04-19-2011 04:42 AM
Hi,
You need a dummy analog input or output to provide the timing source:
http://digital.ni.com/public.nsf/allkb/51754212AD10BDCE862573BD007BFDD2
04-20-2011 03:09 AM
Hi Virdzs,
thanks for the answer. I didn't suppose that "pattern I/O supported" means it can't be used independently. In my case since the analog and digital task must run with different sampling rate, the only solution is to use a gpctr as a clock source. Not very elegant solution - I expected more from a $1200 device.. 😕
Does the USB-6341 (X series) already contain an independent clock source for this task?
- George -
04-20-2011 03:39 AM
Hi George,
According to the NI-DAQmx Help file it does.
NI-DAQmx Device Considerations --> Digital I/O --> Sample Clock Timing:
"All X Series devices support sample clock timing for digital I/O." without any notes
(NI 622x has the note: There is no dedicated onboard sample clock for digital I/O on these devices. You must use a different clock, typically the AI or AO Sample Clock)
04-20-2011 05:27 PM
I think the help file what I use is probably obsolete (Sept.2005), because neither X series nor 6221 is mentioned in the "sample clock timing" section.
I tried to download the latest version of the help file, but the official link is dead.. It seems the help file pack isn't published anywhere. I think I will create a new message for this problem. I don't want to download the entire (1.2 GB) ni-daq install package..
Thanks for your help,
- George -