I am using PCI-6229. I need to use digital output channel to generate 20KHz 30%duty cycle pulses.
The datasheet shows DO sample clock frequency can be 1M Hz. But in may application, only 100KHzTimebase can work to generate. But acctually I need at least 200K Hz.
Attached is the Vi I made. Can anyone help me with this problem?
Solved! Go to Solution.
The PCI-6229 doesn't have a digital timing engine, so in order to create a digital task that will run at 1MHz you must use an external sample clock. One thing you can do though is generate a pulse train at your desired frequency using one of the onboard counters of the 6229, and then using that counter output as the sample clock for your digital task. Take a look at the attached modification I made to your VI which shows how to generate your digital task at 1MHz using the onboard counter. You can change the frequency of the counter's pulse train in order to change the frequency of your digital output. Please let me know if you have any questions.
I have another question. Because I want to save the two counter for other use, is there any other ways to create the 1MHz or at least 200KHz sample clock? Because I want to create 200K Hz 30% duty cycle digital pulses.
There is also a terminal on the card called Freq Out which can be used to generate a 1MHz pulse train. Take a look at page 7-23 of the User Manual for more information on this terminal. This can then be routed to your digital sample clock, just as we did with the previous example.
I tried to modify the VI posted in this thread in order to aquire a digital signal with the PCI-6229. Sinc the frequency of the signal is below 1k i tried to devide the signal of ctr0 respectively of freqout by 8 or 16 since 6.25k or 12.5k sampling frequency would be more than enough for my purpose. By the way, when I am using the 100k timebase for the timing of the task the programm is working. Since i try to monitor up to 20 channels, the amount of data genereated is too much. Therefore I tried to use the modified VI.
Sometimes, the VI works, but almost always, the DAQmx - Read VI doesn´t terminate.
Has anybody an idea what i did wrong?
Thank you for your assistance.
One idea that you can try is to give the Read VI a timeout.
Another idea is to use the DAQmx Configure Input Buffer VI to make the buffer bigger if you think that there is too much data.
Do any of those work?