02-01-2007 12:11 PM
02-05-2007 09:24 AM
Hello,
Just to clarify, you have one task set up for frequency measurement and another one set up for just analog input, and when you reduce the expected frequency range on your frequency task, the sampling rate of the analog input task seems to be reducing as well?
Could you also clarify the following statement please. " I'm using a waveform with buffered acquisition for the read on the AI channels and obviously there is no waveform for the frequency measurement so I'm just combining the signals using the dynamic data. "
Thank you,
Raajit Lall
Applications Engineer
National Instruments
02-07-2007 09:00 AM
02-07-2007 10:31 AM
Basically, the very fact that you're *doing* a frequency read suggests that you don't know the expected freq ahead of time, and probably suggests that it can vary. The waveform datatype assumes a constant interval between samples which wouldn't generally be true for frequency measurement, and that's why you can't use it. Since the actual timestamps of the frequency measurements are NOT the same as those in the analog waveform, it's likely a mistake to pretend they are.
My method is to create my own array of "timestamps" for the frequency data. Create a For loop with a shift register initialized to 0 from outside the loop. Let your freq array auto-index the loop. On each element, perform (1/x). Add result to the left-hand shift register value and write it to both the right-hand shift register and to an auto-indexing output. When the loop completes, the output array will hold timestamps that correlate to your freq measurements. From there you can choose whether to display on an X-Y Graph, or whether to perform some interpolations to calculate freqs at the analog sample times or vice versa.
-Kevin P.
02-07-2007 12:05 PM