Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Pattern generation with USB-6221?

Solved!
Go to solution

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 -

0 Kudos
Message 1 of 5
(3,987 Views)
Solution
Accepted by topic author George_Cs

Hi,

 

You need a dummy analog input or output to provide the timing source:

http://digital.ni.com/public.nsf/allkb/51754212AD10BDCE862573BD007BFDD2

 

0 Kudos
Message 2 of 5
(3,976 Views)

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 -

0 Kudos
Message 3 of 5
(3,962 Views)

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)

0 Kudos
Message 4 of 5
(3,960 Views)

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 -

0 Kudos
Message 5 of 5
(3,949 Views)