The sampling rate is configured by the "Rate" input of the DAQmx Sample Clock vi.
I would strongly recommend you move all of the DAQmx driver vis except the DAQmx Write vi outside of the while loop. Starting, configuring, and stopping a DAQmx task on every loop iteration is very processor intensive. Instead, we should configure the task once, do the writing in the while loop, and then close the task after we leave the loop. I've added a screenshot below to demonstrate what I'm trying to explain.
Also, your current setup is pulling your sample clock from an external source. Is this intentional? If so I'd recommend looking at the "Cont Write Dig Port-Ext Clk.vi" shipping example. You can locate this example using the Example Finder (Help » Find Examples...) and selective Hardware Inputs and Outputs » DAQmx » Digital Generation.
If you don't mean to be using an external clock, simply remove that control and the device will choose the correct internal clock for you.
Thanks you for your help.
I have tried that but I was told " I have give a external clock" see attachment.
I don't care what kind of sample clock I use, internal or external. I just want to get 1MHz DO sample rate. How can
I do it? Same means I write one "1" to the PXI 6733, it's dutation is 1 us.
Additionally in my PXI 8196 system there are PXI 6224, 6704, 5421.
Have a nice day,
If you don't need an external clock, I'd recommend you look at the "Correlated Dig Write with Counter.vi" example. You can locate this example using the Example Finder (Help » Find Examples...) and selective Hardware Inputs and Outputs » DAQmx » Digital Generation. You will need to choose your digital lines, select ctr0 for your card as the counter, and set the rate in Hz that you would like to write, then define the number of points you would like to write at that rate.
Thank you so much. I did not find "Correlated Dig Write with Counter.vi" in Outputs » DAQmx » Digital Generation. Could you email me that VI? My email is firstname.lastname@example.org, Thanks again.
So that other people can use the example also, I've attached it to this message saved for LabVIEW 7.1. If you have problems downloading it, I can also e-mail it to you.
Unzip the three VIs to your hard drive. You may need to point the main VI to the two sub VIs when you first open it.