03-26-2018 08:03 PM
Hello,
I've inherited a waveform generator written in CVI and for the life of me I can't get it to output the proper frequency sine wave. I have an NI USB-6212, and when I tell it to, for example, use an output clock rate of 127168 samples per second and then get it's actual sample rate with DAQmxGetTimingAttribute, it gives me a value of 127388.55.... Does anyone know why this is? The method my boss uses for waveform generation is to produce a fixed size buffer and then vary the sample rate to generate the proper frequency output. This isn't exactly my first choice in technique, but I'm not thrilled about the idea of rewriting a fairly lengthy piece of code. Thank you for your time.
Surge
Solved! Go to Solution.
03-27-2018 03:59 AM
What is true is that you cannot obtain every exact output frequency you want: board timebase can be dividied by integer values to obtain the actual sample frequency, which means that only a subset of the possible frequencies can actually be obtained. This is explained in this document: despite being aimed at LabVIEW, the conceptual part is valid for CVI as well.
Now, what really puzzles me is that value of 127388.55 that you receive: I would have expected an actual sample clock of 126582.2 instead (timebase 10 MHz / 127168 = 78.6 which gives 10 MHz / 79 = 126582.2)