06-25-2009 04:21 PM
06-26-2009 04:56 AM
Hi NT,
Good Morning and I hope your well today. Thanks for your post.
What hardware setup are you using - what module?
Also, what signal are you acquiring from, what rate is it?
If you do have a limit, then I feel you have a few options.
1. Just ignore X samples i.e. if you want a rate of 1Hz, then dump the other samples to achieve that.
2. Take a mean of the samples - if you wish to have some reflection of the data in your saved file
Please reply and I'd be happy to help,
06-26-2009 06:03 AM
To add, for option 1 you can use the decimate 1D array function.
Felix
06-26-2009 10:28 AM
Thanks for the replies. Okay, I've tried the decimate array thing, but it doesn't appear to be doing anything. I let it run for a couple minutes and pasted it into excel and both files are the same length. I've created a new VI where it is reading in 3 analog channels with nothing connected to them. So, the values pulled in are just channel noise. Also, whenever it is writing to the data file it is writing two sample per line before starting on the next row.
06-26-2009 10:39 AM
If you look at the data in a text editor, you will see that the decimate worked, but on the columns.
Write your data after the while loop and use the Write To Spreadsheet vi.
Propably you will need transpose array and a for loop for the decimate...
Felix
06-26-2009 11:35 AM
Why do I need to write the data outside the while loop? The reason I ask is the real system I am working with is going to run for 14 days+. So, I don't think there is enough memory to hold all of those data points before they are written.
Also, what would be the best way for an averaging approach? Is there a way to create an array that would hold say 5 values at a time, one for each of the 3 analog channels, take the average of the 5 values, write the 3 averages to the file, and then clear the array for the next 5 value?
06-26-2009 04:35 PM
I don't see how you can possibly say the decimate function does not work. Simply looking at the file size says it does and if you were to look at the data, you would see that your are reducing the 5 values to 2 - exactly what the decimate is supposed to do.
If you want the mean, just wire that up (Mean function is on the Mathematics>Probablility & Statistics palette) instead of the decimate. You'll have the 5 elements of the array going in and a scalar being output. Everything else (holding 5 values and being cleared for the next is already in your code.
p.s. You really don't need to do that whole mess with the Split Signal and Convert From Dynamic Data. Just use the Index Array and get Waveform Component. And instead of two Format Date/Time String, why don't you just use a single Get Date/Time String function? Another very strange thing about your code is all of the repetition of parsing, formatting, Write to Spreadsheet, etc. for the second file.
06-27-2009 03:05 AM
06-29-2009 10:51 AM
06-30-2009 04:24 PM