04-13-2011 09:05 AM
Scott,
altenbach and I recently had the discussion about the best way to insert and remove elements in an array that acts as a circular buffer. He put together a great example if you want to check it out here.
Eric
04-13-2011 09:59 AM
Will appending the data to an array not skew the data? Like was said before, we don't have the DAQ triggered, so the data just comes in when the loop gets to it. This means we don't know the phase coming in, correct?
So if the previous set has a zero crossing close to the end, and the new set has one close to the beginning (less than a half-period difference), won't that change the measurement?
04-13-2011 11:16 AM
Scott,
Now that I'm looking at Meas Freq of Visible Waveform VI, I think you might have to set it up differently. It measures the time of half cycles from one data set and averages them. Because you are sampling at 10k, you don't have enough resolution to measure the frequency of individual cycles to two decimal places. You need a function that marks the first and last zero crossing from a larger data set and uses the time between those two to calculate frequency.
That new VI would use data from your stored array rather than being fed directly from the filter express VI. The filter data would be inserted into an array that was stored on a shift register and that would be the larger set of data that your frequency VI would use for calculation.
Do you have some idea of how to go about that or do you need more help?
Eric