04-29-2010 05:00 AM
Solved! Go to Solution.
04-29-2010 07:52 AM
04-29-2010 08:12 AM
Thank you Randall. I didn't know the timebase is 20 MHz. Now it's clear.I figured out how it works.
Anyway, I found a better suited exemple for me in Labview 8.6, which of course i use it and learn from it. I managed to obtain what I was asking for with a little tunning
Now i have to focus on my programm with steps, pauses, and so on.
Thank you.
04-29-2010 11:20 AM
I'm just extending the discussion a bit so I can give some context before pointing you to a nifty link. Basically, I found a good solution to this kind of problem, but it [seems to] need solving only rarely. I'm not certain it'll be useful to you right now, but there's a possibility. I'm not very familiar with the CDAQ hardware and my idea is best suited for hardware-clocked buffered AO.
Some things to think about:
1. The specific analog frequencies (I'm imagining sine waves, but, whatever) you can generate depend on more than *just* the internal timebase of 20 MHz. They also depend on the # of samples you define per buffer of the waveform. By choosing a different # of samples per buffer, you'll find that there's a different set of discrete freqs you can generate.
2. It starts getting helpful to think about period instead of frequency. So you can generate samples only at integer multiples of 50 nanosec periods. Now your next job is to make your AO waveform end at one of those points.
3. Here is the key. Your AO waveform buffer can be defined to hold more than 1 cycle of the waveform! As an example, suppose you wanted to generate at 300 kHz. That's a 3.3333333333333... microsec period. You can't land on that exactly using multiples of 50 nanosec. But you don't have to stop there -- just define your buffer to hold 3 cycles of the waveform. That requires 10.0000000 microsec which you *CAN* land on.
The general problem is to match one integer # of timebase periods with a different integer # of waveform cycles such that they both land at the same place. So after all that preamble, let me point you to a solution I shared previously.
-Kevin P
04-29-2010 02:57 PM
Another approach is to disable automatic regeneration of data and continuously feed DAQmx new pieces of the waveform. This way, each piece of the waveform does not need to contain an integral number of periods of the signal. However, this requires you to keep generating new pieces of the waveform, and the beginning of each piece must match up with the end of the previous piece.
DAQmx ships with an example demonstrating this: <LabVIEW Dir>\examples\DAQmx\Analog Out\Generate Voltage.llb\Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi
dsasorin, is this the "better suited example" you alluded to in your previous reply?
Brad