06-20-2012 04:51 PM
I am collecting pressure data at a rate of 1 Hz and writing it to a file for future analysis. The tests I am running take several days to run, so even at a rate of 1 Hz the data files get quite large fairly quickly. Therefore, I am subsampling the data at a rate of 1 point per minute (using Resample Waveform vi). With this smaller dataset I am both plotting it in real time (waveform plot) and writing a second file to disk. My problem is that the smaller file isn't turning out to be any smaller because zero-values are being written to the file for 59 seconds. What I need is for nothing to be written to the file during this span and only have data written to the file when it is subsampled. I am a Labview neophyte and therefore don't have a lot of experience and/or knowledge to call upon. Any ideas?
06-20-2012 05:05 PM
The simplest solution is to sample at a lower rate. Instead of 1Hz, why not sample at 1/60 Hz?
How are you currently polling the pressure sensor? Are you using a loop with a time delay? Seeing your code will help tremendously in suggesting a solution.
06-21-2012 09:59 AM
I agree that the simplest solution would be to lower the sampling rate, although I need the 1Hz data in case there are any anomolies that occur during data collection so I can go back and review what happened at a finer scale. As I mentioned, I am new to LV and this is the first code I've worked on, so feel free to offer any suggestions to improve it (especially in regards to timing).
Thanks.
06-21-2012 10:25 AM - edited 06-21-2012 10:26 AM
Hi,
I can't view your VI (i'm working on 2010), but you could simply check your data is non-zero (use the comparison pallete) and only write these values to your file (use a case structure).
-CC
06-21-2012 10:43 AM
That is what I am trying to do now but unsure of how to go about it. Any quick and dirty suggestions or examples?
06-21-2012 11:05 AM
HI,
Below is a vi snippet from your code. It looks at the first element of your data, checks if it is zero and writes it to a file if it isn't. You can play around with the idea to get something to work....
As suggested above you can avoid all this if you samle at 1/60Hz. From your code it looks like the loop rate is being set by your acquisition - set at 1Hz and when you do your continuous resampling it generates 59 zeros to pad your signal.
If you prefer to average your data instead you could also try the option I put in the second vi snippet. This adds your data to an array and when the array reaches a size of 60 it averages the contents and starts a new array.
All the best,
Dave
06-21-2012 11:07 AM
I'll give this a try and see how it goes. I really appreciate your help.